Re: if-modified-since and last-modified
Andrew Daviel (andrew@andrew.triumf.ca)
Tue, 5 Aug 1997 12:24:36 -0700 (PDT)
On Tue, 5 Aug 1997, Tom Valley; (Consultant - Murphy 97) wrote:
> Hi,
>
> Apparently, some, if not most, web servers do not return the last-modified tag.
> However, I have noticed that all of them respond to the if-modified-since
> method. I can accurately measure if a page has been updated in the last 24
> hours, even though the last-modified method fails every time. Why is this?
Dunno. By "last-modified method" do you mean HEAD ?
In my experience with Apache (Unix), Last-Modified is always sent for
regular files and is generated from the filesystem date. It is not sent
for Server-Side-Include or Server-Side-Exec files (which are made of
many bits) unless e.g. the XBitHack method is used.
It is not sent from CGI scripts unless someone puts it there (they
ought to - it helps caching).
Normally I believe browsers store the last-modified date in their cache
along with the content. (In Netscape you can enter "about:document" to
see this stuff). If a request to verify the URL (Reload, or depending on
network option settings) is made, the browser sends GET with
If-Modified-Since set to the cached value. If a document didn't have a
Last-Modified header, the browser may possibly use the time the document
was stored (though I haven't checked this).
CGI scripts and other objects that don't support the If-Modified-Since
header will just ignore it, so you will just get the document.
> What value is this method examining, and is there a way to expose this value?
> Even for those sites that don't have the last_modified value defined, I'd like
> to store the time of the last modification, if I can get it from this other
> method.
What I've done is compute a checksum for a document and store that.
If the checksum hasn't changed, then the document hasn't. I still can't
tell when it was really modified but it puts some bounds on it, plus
I have to do a full GET every time.
Andrew Daviel
TRIUMF & Vancouver Webpages