Hi,
We are currently experiencing a problem with varnish caching the XML sitemap for the default lifetime for a resource that does not specific a minimum cache lifetime.
Can a 'Cache-Control' header of 'max-age' be added ?
Attached is a simple patch that provides this.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | xmlsitemap-max-age-7.patch | 743 bytes | klidifia |
Issue fork xmlsitemap-1959468
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #1
Anonymous (not verified) commentedNot a bug certainly.
Comment #2
chris matthews commentedThe 6 year old patch to xmlsitemap.pages.inc does not apply to the latest xmlsitemap 7.x-2.x-dev and if still applicable needs a reroll.
Comment #3
klidifia commentedReroll: Commented line in the $headers array was removed.
Comment #4
rpayanmComment #5
dave reidDo we also need to fix this in D8?
Comment #6
dave reidLooks like it.
Comment #7
klidifia commentedA reroll for 7.x
Comment #8
malcomio commentedOn #3521048: /sitemap.xml reverse proxy cache issue – cache-control header should be configurable in admin UI, @kepesv suggested adding a UI to set the cache-control value, and @bmunslow provided a patch, although that explicitly sets a no-cache header.
Comment #10
malcomio commentedComment #11
malcomio commentedComment #12
loze commentedshould this be against 2.x ?
Comment #14
malcomio commented@loze yes you're probably right - because 8.x-1.6 is a more recent release than 2.0.0, I assumed that was the active version.
Have opened MR 75 against 2.x, but haven't tested that branch fully yet
Comment #15
malcomio commentedHaving applied this patch, we have observed odd behaviour where incomplete sitemap pages are cached in Cloudflare.