Re: Transparent Content Negotiation and Caching

Juliusz Chroboczek <[email protected]>
Newsgroups gmane.comp.web.polipo.user
Message-ID <[email protected]>
Everything you say is right, as usual.

> * The HTTP parser sets cache_control.flags |= CACHE_VARY when the
>   response contains a Vary header (http_parse.c:1206). I couldn't see
>   polipo checking the _value_ of the Vary header anywhere, so it clearly
>   doesn't cache different variation of the response to fulfil subsequent
>   requests based on the new request's Accept-* headers.

That's right.  It will revalidate every instance with Vary.  (This
triggers a bug in Apache's mod_gzip, which we work around by checking
the size and MIME type in addition to ETag and Last-Modified during
revalidation.)

> * There are additional CACHE_VARY checks in validateEntry (diskcache.c)

That one's easy -- ignore on-disk data that has Vary but no ETag.  If
you don't, you could be merging data from different instances (the one
in memory and the one on disk).

>   and httpTweakCacheability (http.c) that I haven't read through.

That one's probably redundant, but it cannot harm.

-- Juliusz

------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.