Ok, I did a search through the documentation, and unless I'm just missing it, there isn't anything explaining what 'Minimum sitemap lifetime' does. I also did a search of issues, but there are only vague references to it, suggesting that it may limit the frequency of sitemap updates in some way.

Can you please describe exactly what the 'Minimum sitemap lifetime' setting does for me? :-)

Comments

dave reid’s picture

Ok let's see if I can explain it in a situation:

- Let's say you have a very active site, so your site's cron is set to run every 15 minutes.
- Let's also say that the sitemap files were last generated at midnight of this morning and you have the minimum sitemap lifetime of 12 hours.

- Every minute or two, people are adding comments to nodes that are 'visible' in the sitemap.
- When those comments are added, the data in the {xmlsitemap} table for those nodes is being changed (specifically the {xmlsitemap}.changefreq column).
- When values that affect how the link is outputted in the sitemap (like changefreq), the module sets a variable called xmlsitemap_regenerate_needed to TRUE.
- So every time cron runs between midnight and noon, xmlsitemap_cron() checks two things before it can regenerates the cached sitemap files:
- If the xmlsitemap_regenerate_needed variable is TRUE
- And if the last time the sitemap files were generated plus the minimum sitemap lifetime is less than the current time
- When the sitemap files are regenerated, the variable is set back to FALSE.

- So in this case, even though the data is changing, your sitemap will not be regenerated until noon or later.
- If you had a minimum sitemap lifetime set to "No minimum", your sitemap would literally be regenerated every time cron is run. Since there is a lot of data involved in this process for larger sites, this can be very expensive.
- Search engines don't crawl your sitemap.xml every 15 minutes, so it's not useful to always have an absolute up-to-date sitemap, but the option is there if you want to do that.

Does that explain it a little better? :)

gregarios’s picture

Oh... I see! I didn't realize the sitemap was being updated when new comments were added to a node. :-)

dave reid’s picture

The sitemap files aren't updated, it's the data that's used to generate the sitemap files. Any actual file regeneration from the data happens only on cron. Any suggestions on how we could (briefly) help document this option in the interface?

avpaderno’s picture

To briefly document the option could generate some kind of misunderstanding of its purpose. Things like this are better documented through Advanced help (if I remember well, there is already a plan to add support to that module).

gregarios’s picture

"Sitemap Lifetime" were the key words that confused me. Lifetime tends to mean 'a total period of time that something is alive' and doesn't describe this very well. I believe calling it Minimum Sitemap Update Period would have suited me better, but that's just me. :-) No need for further help, then.

dave reid’s picture

But see lifetime is the exact right word because that's how long the cached files will *exist( without being updated/changed. :)

gregarios’s picture

Then it is a minimum cache lifetime, not sitemap. The sitemap will be there continuously from the moment it is created! lol
That is what was confusing... I couldn't figure out how you could have a minimum sitemap lifetime of several hours if it was brand new as of 3 minutes ago. (So the minimum was obviously zero seconds, really, right?)

Most people don't know what is going on underneath... all they know is the sitemap appeared and stayed there. It then gets updated "periodically." So, to me the setting was describing the sitemap, not a cache. (no matter what it is doing... it is updating the sitemap every so often)

dave reid’s picture

Version: 6.x-2.0-unstable4 » 6.x-2.x-dev
BigMike’s picture

I realize this is an ancient topic, but I also found confusion with "Minimum sitemap lifetime" and found this while searching to see what it exactly means.

I have not contributed to this excellent module, and deeply appreciate it as it is a huge help for my site, so this is just as an additional reference that I also agree with gregarios that "Minimum cache lifetime" is a better fitting description and would have prevented me searching for clarification.

Just my 2 cents, again thank you for this GREAT module and have a nice day!
BigMike

avpaderno’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

I am closing this issue, which is for a not supported Drupal version.