Is this FAQ fodder ?

In message <[EMAIL PROTECTED]>, =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?=
 writes:
>"Poul-Henning Kamp" <[EMAIL PROTECTED]> writes:
>> You could try the following in vcl_recv:
>>
>>      if (req.http.accept-encoding) {
>>              set req.http.accept-encoding =3D regsub(
>>                  req.http.accept-encoding,
>>                  "gzip, *", "gzip,");
>>      }
>>
>> to get rid of the space(s), but it is not guaranteed to get all cases.
>>
>> Alternatively, the more brutal:
>>
>>      if (req.http.accept-encoding ~ "gzip") {
>>              set req.http.accept-encoding =3D "gzip";
>>      } else {
>>              unset req.http.accept-encoding;
>>      }
>>
>> Will get the desired effect in all cases, provided your backend does
>> not attempt deflate as fallback.
>
>A slightly more complex solution, to cover all bases without losing
>functionality:
>
>set req.http.accept-encoding =3D regsub(req.http.accept-encoding,
>    "^ *gzip, *deflate *$", "gzip,deflate");
>set req.http.accept-encoding =3D regsub(req.http.accept-encoding,
>    "^ *deflate, *gzip *$", "gzip,deflate");
>
>This should take care of >99% of cases; I don't know of any browser that
>supports only one of the two, or supports anything *but* those two.
>
>However, Apache only supports gzip, so Poul-Henning's solution is
>sufficient in this case.
>
>DES
>--=20
>Dag-Erling Sm=C3=B8rgrav
>Senior Software Developer
>Linpro AS - www.linpro.no
>

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED]         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.
_______________________________________________
varnish-dev mailing list
varnish-dev@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-dev

Reply via email to