lastmod
Optional. Either a method or attribute.
If it’s a method, it should take one argument – an object as returned by items()
– and return that object’s last-modified date/time as a datetime
.
If it’s an attribute, its value should be a datetime
representing the last-modified date/time for every object returned by items()
.
If all items in a sitemap have a lastmod
, the sitemap generated by views.sitemap()
will have a Last-Modified
header equal to the latest lastmod
. You can activate the ConditionalGetMiddleware
to make Django respond appropriately to requests with an If-Modified-Since
header which will prevent sending the sitemap if it hasn’t changed.
Please login to continue.