I have a question. I noticed that when checking the “modified date” of a topic on Discourse, the modified date always corresponds to the date in which the page is being browsed.
Is there some way to alter the Last Modified date, at least in topic pages?
I am unclear about what you mean by “corresponds to”.
If you mean that the time always indicates “current time”, that sounds like a bug.
If you mean what I would call “in relation to current time” eg. 4 days ago, instead of February 23 2018 I think a plugin should be able to use the timestamp to show the actual date instead of the time interval.
If I check the Last-Modified header for this old thread from 2016, the Lqst Modified date corresponds to the moment I browsed the website, not to the moment it was last updated:
The content on that page is updated every time it’s loaded. For example, look at the Suggested Topics section.
A Last-Modified header is not part of the discourse API. It’s a recommendation to the web browser (to be used in conjunction with the Cache-Control header) that the page being requested is dynamic content and should not be cached.
Thanks, I am familiar with HTTP caching and the way headers are used.
The issue started for me when working with existing search platforms/plugins acting as web spiders (so indexing the pages from the outside, without direct access to the discourse DB), which seem incapable of extracting the last update date from Discourse and rely instead on the Last Modified date.
I think I might work around this by adding a “published” meta tag and forcing the plugins to use that date.