mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Fixed #20793 -- Added Last-Modified header to sitemaps.
This commit is contained in:
@@ -178,6 +178,15 @@ Sitemap class reference
|
||||
representing the last-modified date/time for *every* object returned by
|
||||
:attr:`~Sitemap.items()`.
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
If all items in a sitemap have a :attr:`~Sitemap.lastmod`, the sitemap
|
||||
generated by :func:`views.sitemap` will have a ``Last-Modified``
|
||||
header equal to the latest ``lastmod``. You can activate the
|
||||
:class:`~django.middleware.http.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.
|
||||
|
||||
.. attribute:: Sitemap.changefreq
|
||||
|
||||
**Optional.** Either a method or attribute.
|
||||
|
||||
@@ -95,6 +95,12 @@ Minor features
|
||||
* The :djadminopt:`--no-color` option for ``django-admin.py`` allows you to
|
||||
disable the colorization of management command output.
|
||||
|
||||
* The :mod:`sitemap framework<django.contrib.sitemaps>` now makes use of
|
||||
:attr:`~django.contrib.sitemaps.Sitemap.lastmod` to set a ``Last-Modified``
|
||||
header in the response. This makes it possible for the
|
||||
:class:`~django.middleware.http.ConditionalGetMiddleware` to handle
|
||||
conditional ``GET`` requests for sitemaps which set ``lastmod``.
|
||||
|
||||
Backwards incompatible changes in 1.7
|
||||
=====================================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user