Gzip issues with Varnish

Dag-Erling Smørgrav des at linpro.no
Mon Apr 30 17:40:36 CEST 2007


Denis Brækhus <denis at startsiden.no> writes:
> One of my developer colleagues has experienced an issue at
> Aftenposten with regards to gzip and varnish.
>
> I think you are experiencing the same issue we had, that is Varnish
> doesn't really handle gzipped data from the backend intelligently
> yet. So you could have the following scenario:
>
> 0. Varnish startup
> 1. Client A (with a gzip capable client) requests object 1
> 2. Varnish will fetch the object from the backend and pass it on to
> the client, and store the gzipped object in the cache
> 3. Client B (with a non gzip capable client) requests object 1
> 4. Varnish will pass on the gzipped object to the client
> 5. The client will not be able to interpret the data received, and
> you get various errors..

Yes, this is exactly what will happen, because Varnish does not yet
understand the Vary: header which the server uses to indicate that the
document it returns can vary depending on request headers.

> We "solved" the issue by disabling gzip on the backend until Varnish
> will handle this properly. For us the sacrifice in bandwidth savings
> was more than negligible when we take into consideration application
> server performance.

Unfortunately, for some applications, the bandwidth savings are
considerable...  which is why Vary: handling is very high on our
priority list.  We expect to have it working in trunk within a couple
of months.

DES
-- 
Dag-Erling Smørgrav
Senior Software Developer
Linpro AS - www.linpro.no



More information about the varnish-misc mailing list