Gzip issues with Varnish

Denis Ahrens denis at zeno.org
Thu May 10 15:38:25 CEST 2007


On 09.05.2007, at 18:44, Poul-Henning Kamp wrote:

> In message <922C786D-54C3-480C-88E2-93DC454B8174 at zeno.org>, Denis  
> Ahrens writes
> :
>> Hi
>>
>> The gzip problem can be circumvented with since revision r1398.
>>
>> Simply add the following to a varnish vcl script:
>>
>> sub vcl_hash
>> {
>>         if (req.http.Accept-Encoding) {
>>                 set req.hash += req.http.Accept-Encoding;
>>         }
>> }
>
> Well, yes, I guess that does it, but depending on how many
> differnet Accept-Encoding headers there are out there, your
> hit-date may drop and your cache-size explode

Ok, I changed it a little to reflect that:

sub vcl_hash
{
         if (req.http.Accept-Encoding ~ "gzip") {
                 set req.hash += "gzip";
         }
         else if (req.http.Accept-Encoding ~ "deflate") {
                 set req.hash += "deflate";
         }
}

We only have gzip support, so this should be ok.

Denis Ahrens




More information about the varnish-misc mailing list