Non-optimized templates
That's right... Depending on how Movable Type is configured, you will see a 'thank you' message after submitting an entry or a comment, and this message is rendered on-the-fly by the CGI script you are submitting to. When searching the search results page is also rendered on-the fly.
Now, the basic contents of either the 'thank you' message or the search results are quite simple: a few lines of text, or a few summarized entries. In theory, this shouldn't take too long to render, and in practice it doesn't.
But what if these pages contain the same sidebar (for example) that you are using on the rest of your website? This might contain a list of all your archives, the most recent comments, some RSS feeds, a tag cloud and lots and lots of other things.
On the rest of the website, this is no problem: the sidebar and its content are generated at publishing time, so it just sits there, ready to be served. But in the 'dynamically' rendered comment/entry reply or search template all of this content has to be rendered 'on-the-fly', and all this adds seconds (sometimes even minutes) to the waiting time.
How to fix this?
The basic way to fix this is to set up caching and server side includes for the parts of the template that are slowing things down. Alternatively, you can remove these parts (do comment submitters really need to see the tag cloud and the archive list etc. again?)
The basic steps to do this are identical to what you would do to optimize your templates for normal publishing, as described here. But this time, you need to do it for your system templates instead of your entry/archive/index templates.

Tweet




Leave a comment