- Issue created by @kepesv
When using a reverse proxy like Engintron (NGINX + cPanel integration), the /sitemap.xml virtual file is cached by the proxy and not refreshed properly, even though the actual sitemap XML files (e.g., sites/default/files/xmlsitemap/...) are updated correctly.
This happens because the XML Sitemap module does not send proper Cache-Control HTTP headers, so the proxy assumes it's safe to cache the response.
Add a configuration option in the admin UI to allow site administrators to set the desired Cache-Control header for /sitemap.xml.
The default setting should be no caching, for example:
Cache-Control: no-cache, must-revalidate
This ensures search engines always receive the most up-to-date sitemap.
At the same time, this should remain configurable, because some administrators may want the sitemap to be cached for performance reasons.
Enable the XML Sitemap module and configure sitemap generation.
Create node which is included in the XML sitemap. Run cron.
Serve the site behind a reverse proxy such as Engintron.
Load /sitemap.xml — it gets cached and doesn't reflect updates.
The underlying file in sites/default/files/xmlsitemap/... is updated.
Visiting /sitemap.xml?foo=1 bypasses the cache and shows the updated version.
This behavior can lead to search engines indexing outdated sitemaps.
Easily testable with any reverse proxy setup (e.g., NGINX, Varnish, Cloudflare).
A simple header configuration in the module output could solve this.
Thanks in advance!
Active
2.0
xmlsitemap.module