On a recent call with the Movable Type Community we discussed and shared tips on how to best take advantage of Movable Type's built in caching system. One of the tips I shared is something I have been doing on my personal site and on a number of customer sites with great success, and it relates to how to optimize the publication of a Google Sitemap in a sustainable way.
Google Sitemaps have become an essential tool for bloggers to help optimize their content for search engines, also known as SEO or "Search Engine Optimization." Google Sitemaps are files published by a web site that detail each and every page on the web site and give some indication as to the frequency they are updated by the system. This helps ensure that when the Google fairy visits your site to slurp up and index your site's content that:
Google indexes all of your content, and does not overlook any content that might be orphaned on your site because no other page links to it directly.
Google is able to schedule additional visits of the Google Fairy when your content is likely to be updated.
Anyone can publish a Google Sitemap for the Movable Type powered web site or blog using a template provided by the community. This template has a number of parameters in it that can be used to fine tune your sitemap specifically for your web site. The challenge rests however in publishing this file. For some large sites, publishing a Google Sitemap can dramatically slow down publishing, as Movable Type needs to load every single entry and page into memory while it outputs a monstrous XML file. Some of these files have known to grow larger than several megabytes.
You can mitigate the impacts of publishing a sitemap by following these simple steps:
Create a template module called "Google Sitemap Include" and paste into it the template provided by the community.
For your "Google Sitemap Include" module turn on caching and set the cache to expire once every 24 hours.
Now, create an index template called "Google Sitemap" and paste into its body the following template code:
<mt:include module="Google Sitemap Include">
What this does is result in a Google Sitemap being published only once per day. This keeps your Google Sitemap up to date, while only incurring the cost of publishing it once. Handy. Of course this technique could be applied to virtually any template that can take a long time to publish, but also doesn't need to be up to date on a minute-by-minute basis.
We share a lot of tips on our community conference calls, you should join us next time!