Why are there calls to drupal_write_record() in xmlsitemap_output()? xmlsitemap_output() should only *output* the current sitemap. When we want to change the sitemap contents, this should be (re-)generated in hook_cron(), since this operation is extremely expensive (try viewing sitemap.xml using the test data I uploaded with 20,000 nodes, for example). It seems like the current behaviour could be very damaging from an SEO standpoint if search engines ping a sitemap URL and don't get a page returned to them within seconds.
I think this would also allow us to get rid of the confusing situation where you need to wrap this callback in a check for anonymous users.
Comments
Comment #1
avpadernoThe main problem is that the modules use their own database tables that are different from the table used to contain the site map links; this means the modules must implement a hook that allows them to create the links in the site map table, which need to be called at some point during the execution.
What I thought to do (in the 2.x branch) is to remove the module tables to use a central database table.
I think that the site map must not only filled during cron tasks execution, but also during the execution of other hooks, like
hook_nodeapi(); using just cron tasks would make the process slowly, when there are hooks that operate on single objects at time (and for each page request).Comment #2
avpadernoThe change suggested can only be implemented when the database tables used will be changed. I am setting this report as postponed for the next branch.
Comment #3
avpadernoI am changing the referring version.
Comment #4
dave reidThis is now and has been how the module operates in 6.x-2.x-dev. Marking as fixed.
Comment #5
avpadernoI am reopening the report because I would like to investigate if this is possible to implement in the 1.x branch.
Comment #6
avpadernoThis will be implemented when #463564: Remove the central database table will be.
Comment #7
avpaderno- Duplicate comment -
Comment #8
avpadernoThis has been implemented.
Comment #9
avpadernoComment #11
avpadernoAs result of rolling back the code, the sitemap is updated when it is viewed.
Comment #12
avpadernoComment #13
Anonymous (not verified) commentedI don't see this for 1.x version. Will postpone until after 6.x-1.0 is released.
Comment #14
Anonymous (not verified) commentedSince this is being addressed by 2.x I'll leave it there.