Accept-Enconding stripped
Hettwer, Marian
mhettwer at team.mobile.de
Mon Aug 29 19:10:12 CEST 2011
Hi All,
I'm having trouble to understand my varnish (that's kinda rare).
I'm trying to cache a url with and without gzip'ed.
Apparently, I'm doing something wrong, because usually varnish would not
strip away headers, unless I told him so.
This is a request to varnish, running on localhost:
curl -v -s -o /dev/null -H "Accept-Encoding: gzip" -H
"Host:kleinanzeigen.ebay.de"
"http://localhost/anzeigen/s-beliebte-angebote.html?catId=241&letter=z"
* About to connect() to localhost port 80 (#0)
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 80 (#0)
> GET /anzeigen/s-beliebte-angebote.html?catId=241&letter=z HTTP/1.1
> User-Agent: curl/7.18.2 (x86_64-pc-linux-gnu) libcurl/7.18.2
>OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.8 libssh2/0.18
> Accept: */*
> Accept-Encoding: gzip
> Host:kleinanzeigen.ebay.de
>
< HTTP/1.1 200 OK
< Server: Apache
< Cache-Control: public, max-age=86400
< Content-Language: de-DE
< Vary: Accept-Encoding
< Content-Type: text/html;charset=UTF-8
< Content-Length: 15828
< Date: Mon, 29 Aug 2011 17:01:27 GMT
< X-Varnish: 800174289 800173404
< Age: 2
< Via: 1.1 varnish
< Connection: keep-alive
<
{ [data not shown]
* Connection #0 to host localhost left intact
* Closing connection #0
I'm missing the "Content-Encoding: gzip" response header.
If I'm sending the request against the apache backend, it looks like what
I would expect:
curl -v -s -o /dev/null -H "Accept-Encoding: gzip" -H
"Host:kleinanzeigen.ebay.de"
"http://apache/anzeigen/s-beliebte-angebote.html?catId=241&letter=z"
* About to connect() to apache port 80 (#0)
* Trying 10.xx.xx.xx... connected
* Connected to febayk46-1 (10.xx.xx.xx) port 80 (#0)> GET
/anzeigen/s-beliebte-angebote.html?catId=241&letter=z HTTP/1.1
> User-Agent: curl/7.18.2 (x86_64-pc-linux-gnu) libcurl/7.18.2
>OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.8 libssh2/0.18
> Accept: */*
> Accept-Encoding: gzip
> Host:kleinanzeigen.ebay.de
>
< HTTP/1.1 200 OK
< Date: Mon, 29 Aug 2011 17:03:59 GMT
< Server: Apache
< Cache-Control: public, max-age=86400
< Content-Language: de-DE
< Vary: Accept-Encoding
< Content-Encoding: gzip
< Content-Length: 3284
< Content-Type: text/html;charset=UTF-8
<
{ [data not shown]
* Connection #0 to host febayk46-1 left intact
* Closing connection #0
Look, there it is. It's encoded in gzip. So the backend would actually
gzip. But if I'm going through my varnish instance, it's not gzip'ed
anymore.
Whereas, if I use firefox, I get a gzipped answer via varnish.
Firebug answer section:
Server: Apache
Content-Language: de-DE
Vary: Accept-Encoding
Content-Type: text/html;charset=UTF-8
ntCoent-Length: 15828
Date: Mon, 29 Aug 2011 17:06:58 GMT
X-Varnish: 800298936 800173404
Age: 333
Via: 1.1 varnish
Connection: keep-alive
Cache-Control: private
Content-Encoding: gzip
Content-Length: 3254
This is really strange. Am I missing something obvious here?!
Thanks for any hints / pointers.
BeSD regards,
Marian
More information about the varnish-misc
mailing list