Strange different behavior
Kristian Lyngstol
kristian at redpill-linpro.com
Thu Jan 14 22:50:25 CET 2010
On Wed, Jan 13, 2010 at 06:45:26PM +0100, Bernardf FRIT wrote:
> Hi,
>
> I'm facing a pretty strange issue. URLs not supposed to be cached are in
> cache when
> requested by firefox but not by lwp.
(...)
> Vary: Accept-Encoding,User-Agent
This is why.
Vary: means "this page will look different depending on the following
client headers".
Your backend is telling Varnish to expect different variants of the page
depending on what Accept-Encoding AND User-Agent header the client
provides. Accept-Encoding is normal and sane (ie: if one client supports
gzip and an other does not, one client will get a compressed variant of the
page and the other client the uncompressed one).
Vary on User-Agent is generally bad, and you should Just Fix That [tm].
Due to Vary: Accept-Encoding, lwp-request and Firefox will still get
different variants, but you can supply the Accept-Encoding header to
lwp-request, but if you want the content, you'll need to pipe it through
gunzip (headers are still readable).
--
Kristian Lyngstøl
Redpill Linpro AS
Mob: +47 99014497
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20100114/e8d27ea3/attachment-0003.pgp>
More information about the varnish-misc
mailing list