Opened 11 years ago
Closed 11 years ago
#20793 closed New feature (fixed)
Add Last-Modified header to generated sitemaps
Reported by: | Julian Bez | Owned by: | Julian Bez |
---|---|---|---|
Component: | contrib.sitemaps | Version: | dev |
Severity: | Normal | Keywords: | sitemaps last modified |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
From each items lastmod attribute, we can infer the lastmod of the whole sitemap and set this as Last-Modified header for the sitemap. Google will then request with an If-Modified-Since header and bytes are saved.
Change History (7)
comment:1 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 11 years ago
Needs tests: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 11 years ago
Needs tests: | unset |
---|
comment:4 by , 11 years ago
Triage Stage: | Accepted → Ready for checkin |
---|---|
Version: | 1.5 → master |
comment:5 by , 11 years ago
Patch needs improvement: | set |
---|---|
Triage Stage: | Ready for checkin → Accepted |
The current patch will add a Last-Modified header if any item if the feed has a lastmod.
I would expect it to add the header only if all items have a lastmod.
As soon as one item doesn't have a lastmod you really can't say anything about the entire feed.
comment:6 by , 11 years ago
I added a fix for this case. It now keeps track if all items have a lastmod.
comment:7 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
https://github.com/django/django/pull/1391