The reliance on Content-type
Alex Pennace
alex at pennace.org
Sat Nov 19 15:45:55 PST 2005
On Tue, Nov 15, 2005 at 08:49:43AM -0800, Ernst Johannes wrote:
> Has anybody definitive experience with varying Accept headers for the
> same resource, and web caches out there? (I don't)
>
> In other words, are we absolutely sure that if the following passes
> through a cache:
>
> GET /something
> Accept: text/html, (whatever normal browsers do)
>
> GET /something
> Accept: application/xrid+xml, text/html;q=0.5
>
> 99% of all deployed caches will indeed return the XML instead of the
> HTML in the second case?
A properly implemented cache (as opposed to what is actually out
there) would behave as if it was maintaining a list of (URL, requested
accept, response etag) tuples [1]. If a request for a URL does not
have an Accept: field that the cache has already cached, it will
connect to the server (or upstream cache) to request new content or
determine that a cached copy of content, by etag, would satisfy the
request.
As Accept: is subject to server-dependant rules, HTTP proxies should
not interpret unknown Accept: requests.
[1] A properly implented cache, of course, would have a list of much
larger tuples, but the above is sufficient to model this particular
circumstance.
More information about the yadis
mailing list