Ad

Incremental Or On-demand Sitemap.xml

- 1 answer

After reading Jeff's article about the importance of sitemaps, so I decided to generate one for my dynamic website.

I saw some articles about how to implement it with ASP.NET but every solution I saw showed how to generate it on the fly with an HTTP Handler.

But that solution means that every time someone asks for the file, my code has to iterate trought all my entries to re-generate one?

Wouldn't it be less resource consuming to generate it incrementally? For example on stackoverflow, every time a user adds a question, appending the new URL node?

Ad

Answer

You might want to cache the resulting XML and invalidate the cache whenever your site structure changes. This might lead to having a publish/subscribe mechanism for components of your web site, but in case of properly structured application this won't be a problem.

Ad
source: stackoverflow.com
Ad