4 ms·
Last-Modified isn't intended to preserve the date of the content. It represents the modification time of the HTML document, which is used for caching. It may or
by mcav 17y ago
Last-Modified isn't intended to preserve the date of the content. It represents the modification time of the HTML document, which is used for caching. It may or may not -- probably not -- represent the date the article was modified. To try to do so would conflate the purpose of the Last-Modified header.
- jacquesm 17y agoFrom http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html: "14.29 Last-Modified The Last-Modified entity-header field indicates the date and time at which the origin server believes the variant was last modified. Last-Modified = "Last-Modified" ":" HTTP-date An example of its use is Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT The exact meaning of this header field depends on the implementation of the origin server and the nature of the original resource. For files, it may be just the file system last-modified time. For entities with dynamically included parts, it may be the most recent of the set of last-modify times for its component parts. For database gateways, it may be the last-update time stamp of the record. For virtual objects, it may be the last time the internal state changed. An origin server MUST NOT send a Last-Modified date which is later than the server's time of message origination. In such cases, where the resource's last modification would indicate some time in the future, the server MUST replace that date with the message origination date. An origin server SHOULD obtain the Last-Modified value of the entity as close as possible to the time that it generates the Date value of its response. This allows a recipient to make an accurate assessment of the entity's modification time, especially if the entity changes near the time that the response is generated. " The word 'caching' is not mentioned in there at all, those are completely different headers, see the 'cache control' headers in that same document.
- mcav 17y ago> "For entities with dynamically included parts, it may be the most recent of the set of last-modify times for its component parts." The content is often considered a subcomponent of the whole page; other aspects of the HTML may change despite the content remaining the same.
- jacquesm 17y agoThat's a good point, but the 'essence' of the page is the text, the rest of it is just a container. Caching headers could easily take care of all the stuff surrounding the essential part. If the essential part has multiple components then it would make sense to use the latest one for that. If a link to an auxiliary page changes in the navigation that's a job for the cache control headers. Either way the page would get reloaded, but at least you'd have a good idea when the critical component of the page (it's reason for existing in the first place) was updated.