I’m an optimization fiend, and when it comes to HTTP / HTML “stuff”, I know that caching is an incredible way to optimize. So, when I learned of the ability to cache Movable Type Open Source (MTOS) templates, I gave it a shot.
Among others, I was caching the HTML Head template, in which I was setting a variable for an analytics code to be used in the footer of each type of main and archive template. Unfortunately for me, when a template is cached and contains a MT SetVar tag, that tag is no longer processed. It makes sense, but it didn’t sink in for me until a few weeks after I had implemented that strategy. Doh!
I’ve also learned that although global templates can’t be cached, there is a simple workaround where I can include the template in a blog specific template, as long as they have different names. I’m going to do this, and also try setting the analytics code in that template, and cache it. I think it will work, and I’ll post my results here.
