Kjetil Kjernsmo wrote:
On mandag 2. august 2004, 15:50, Tod Harter wrote:
I would think the correct way to ask /. if this has been updated
would be an 'if-modified-since' request....
Anyway anytime the thing gets updated you should see a different ETag
value and a different Last-Modified, so you really just need to look
at the headers, which is what HEAD is for! :o).
Well, but all this is about validation of a cached copy, i.e. section
13.3 of the HTTP 1.1 spec, but what /. is asking is Expiration, i.e.
13.2 of HTTP/1.1... Those are actually different things. The point of
validation is indeed to check if something has happened without getting
the full file, while with Expiration, you're not sending network
traffic at all...
In the absence of an Expires: header doesn't the ETag essentially tell
all? If you issue a HEAD request and get back the same ETag as whatever
is cached then you shouldn't need to refetch the resource, correct?
Similarly you should be able to compare the Last-Modified: header of the
cached copy with one recovered from the HEAD request and determine if
your cache is indeed up-to-date, assuming /. gives you correct info...
So given that you should be able to check for a newer version without
actually asking for the whole file then all you need is to cache a
copy. Doesn't the libwww stuff have some functionality for dealing
with a client-side cache? I could be wrong but I seem to remember
SOMETHING someplace that does. I'm pretty sure there is some code in
CPAN that will check with the origin server to see if its cached copy
is still up to date, refetch the contents of the URL if necessary and
cache it, and return the locally cached copy. Maybe AxKit already
does all this? It would seem like that would be sensible, but then
again perhaps not!
Yup, I think AxKit does its thing far better than slash, anyway. At
least I see Expiration headers in my responses (though they are there
to disable caching).
But the stuff about local caching of remote resources, that's not clear
to me that AxKit does.... Which was the real thing I wondered
about... :-)
I guess what I was talking about is whatever HTTP client library AxKit
(or I guess in this case your provider) uses to issue requests for web
resources. That would be the 'ghttp' library IIRC. Granted there is no
Expires header, but as I said above that shouldn't matter if you have
the ETag and Last-Modified values. I guess maybe I should go back and
review what I know about HTTP/1.1 cache control, maybe I'm missing
something here.
Cheers,
Kjetil
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]