Sitemap implementation means it cannot be updated automatically
|Reported by:||tenkujin||Owned by:||Grzegorz Nosek|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The Sitemap class uses an attribute _paginator which stores all the URLs. The method items() is thus called only once for the creation of the paginator, and subsequent invocations of the sitemap view do not call it. If the items() method is meant to return dynamically changing items (which is a common case), changes are not reflected in the sitemap. The only way to fix this is to either restart Django (not acceptable), override the get_urls() method and update the _paginator (not nice), or re-implement the Sitemap object to not have such semantics (violates DRY).
Since this paginator is a hack to accommodate Google's arbitrary 50k URL limit, I think it would be best to have a Sitemap which can be updated at runtime, and an optional GoogleSitemap for this particular search engine.
Change History (19)
comment:12 Changed 5 years ago by
|Owner:||changed from nobody to Grzegorz Nosek|
|Status:||new → assigned|