Problem/Motivation
simple_sitemap has a notion of the last modified time for each sitemap. It'd be handy if this value appeared as an HTTP header in the response for a sitemap. This can be useful for monitoring, debugging, validation, etc.
This is also related to #3090254: Cached sitemap since if we're going to make sitemap responses cacheable, we'll want to know when each one was actually modified so that caching systems can know when to refresh, etc.
Proposed resolution
When crafting the response for a sitemap, include the last modified date as an HTTP header.
Remaining tasks
- Make the change.
- Update test coverage accordingly.
- Reviews / refinements / improvements.
- RTBC.
- Commit.
User interface changes
None.
API changes
None.
Data model changes
None.
Comments
Comment #2
dwwI looked into this for a bit today. Alas, the internal APIs I'd use to write this properly are either commented out or insufficient for my needs. Seems like it'd be a bigger patch than I was hoping for, at least in the short term. Plus, I'm guessing you're not going to want to set this header on its own, without addressing the bigger questions at #3090254: Cached sitemap.
So, for now, I went with a custom event subscriber for the site where I need this. It notices if we're on a sitemap page and sets the
Last-Modifiedheader directly.That said, if the maintainers are interested in supporting this upstream, please let me know and I'd be happy to try to work on a real patch here.
Thanks,
-Derek
Comment #3
gbyteThanks for your input. Feel free to contribute a patch after #3090254: Cached sitemap has been pushed (where you are contributing already).
This sounds to me like the response headers are necessary or important for the caching process? If that's the case, maybe set this issue as child issue or merge both?
Comment #4
dwwThanks for the reply. Yes,
Last-Modifiedis important for caching. We should either add it directly as part of #3090254: Cached sitemap, or after that's complete. For now, setting this one to postponed. If we don't sort this out as part of #3090254, we can unpostpone this and handle it then. If we add it there, we can move this to "Works as designed". ;)Cheers,
-Derek
Comment #5
gbyteComment #7
walkingdexter commented