Community Blog

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:

  1. 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.

  2. 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:

  1. Create a template module called "Google Sitemap Include" and paste into it the template provided by the community.

  2. For your "Google Sitemap Include" module turn on caching and set the cache to expire once every 24 hours.

  3. 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!

8 Comments

Byrne

That's an excellent tip - thanks for sharing it.

Now to implement it on all my blogs :)

Michele

Can't follow the link to the wiki because the wiki doesn't load.

Hey, Byrne -- Is the Wiki site down? I tried early this morning, and again now (12:30 p.m. PDT). It is still not responding.

Still down. :(

Have to admit that I just create my own with the following site. Let's me double check broken links (And I've got a lot of them.) as I create the sitemap.

Oops, forgot to give the link. Feel free to add the previous comment and remove this one. /me need coffee. :)

http://www.auditmypc.com/free-sitemap-generator.asp

Byrne,

Your advice there about the caching is actually a good one for almost any index archive. I just wish that MT supported whole template caching, but the performance boost should be more than worth the cost of having a template module and a regular template for every index that you want to publish.

By following this principle for most of my index templates, I was able to go from average rebuild time of all index templates of 23-30 seconds down to 8-9 seconds.

I mentioned this on the page that contains the template for the Google sitemap, but I thought I'd post it here, too.

The sitemap does not seem to validate when using it with MT 4.2. It also does not create all your blog's URLs properly. I re-wrote the template to conform with the updated MT tags and remove the deprecated tags. You can find the template code here:

http://www.daveweiss.net/2008/10/google-sitemap.html

Leave a comment

Have a question, please use the MT Forums. Notes sumbitted here should pertain to tips & hints regarding documentation. Your note may be removed once it's contents has be integrated into the body of the page.