Theme Preview Caching
Posted on October 16, 2010
By John Nunemaker
So why did caching theme previews make such a big difference in admin loading speed? Each time the admin does a full load (sign in, refresh, etc.), it grabs all of your sites and their previews and puts them in the site list at the top of the page. This gives you easy access to all your sites and is a great benefit of using Harmony.
The problem was all of those theme previews were being served through Rails and querying the database, which is far less efficient than serving them as normal static files through Apache. Now, once a theme preview is requested, it first checks the file system. If found, it serves the file through Apache and does not hit Rails. If not found, it hits Rails, caches the file, and serves it, so that all future requests for the preview go through Apache.
Nothing that will really blow your mind, but I hope you enjoy the slight speed up. I know I will sleep easier knowing that I can check one more thing off our ever growing todo list.