compression-at-edge, in front of varnish reverse proxy, gzip-compresses some content, but not other ?

Laurence Rowe l at lrowe.co.uk
Wed Apr 28 15:53:18 CEST 2010


OK, it looks like there is something strange set up on one of your
backend servers - the js is being served with Content-Type: text/x-js.
You should probably fix that, or just add it to gzip_types.

Laurence

2010/4/28 Ben DJ <bendj095124367913213465 at gmail.com>:
> Laurence,
>
> On Tue, Apr 27, 2010 at 6:40 PM, Laurence Rowe <l at lrowe.co.uk> wrote:
>> That's a 404 Not Found error message being gzipped because it is
>> text/html (I think Nginx compresses that by default).
>>
>>> Any ideas why/where the .js is not getting gzipped?
>>
>> That is a 304 Not Modified response, which has no body, so nothing to
>> be gzipped.
>>
>> Try doing a shift-reload in firefox to see what you get from the
>> original request (which should return 200 OK)
>
> Missed that :-/
>
> Anyway, clearing all caches, and rebooting the silly server just to be
> sure ;-), here's some LiveHTTPHeader output again -- I *do* see the
> "200 OK" this time around.
>
> The output's referencing  2 .css, a .js, and a .gif.  Iiuc, the .css
> are both gzipped, but the .js & the .gif are not ...
>
> ----------------------------------------------------------
>
> https://my.site.com/apostrophePlugin/css/a.css
>
>
>
> GET /apostrophePlugin/css/a.css HTTP/1.1
>
> Host: my.site.com
>
> User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.4) Gecko/20100417
>
> Accept: text/css,*/*;q=0.1
>
> Accept-Language: en-us,en;q=0.5
>
> Accept-Encoding: gzip,deflate
>
> Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
>
> Keep-Alive: 115
>
> Connection: keep-alive
>
> Referer: https://my.site.com/
>
> Cookie: symfony=NMtNSAJp8s7v-SSl6vBGK-jdpr7
>
> Pragma: no-cache
>
> Cache-Control: no-cache
>
>
>
> HTTP/1.1 200 OK
>
> Server: nginx/0.8.35
>
> Date: Wed, 28 Apr 2010 01:46:17 GMT
>
> Content-Type: text/css
>
> Transfer-Encoding: chunked
>
> Connection: keep-alive
>
> Vary: Accept-Encoding
>
> Last-Modified: Tue, 27 Apr 2010 18:18:16 GMT
>
> Etag: "30367-14e26-4853bead16a00"
>
> Cache-Control: max-age=259200
>
> Expires: Sat, 01 May 2010 01:46:17 GMT
>
> X-Varnish: 1825269930
>
> Age: 0
>
> Via: 1.1 varnish
>
> Content-Encoding: gzip
>
> ----------------------------------------------------------
>
> https://my.site.com/apostrophePlugin/js/jquery.timer-1.2.js
>
>
>
> GET /apostrophePlugin/js/jquery.timer-1.2.js HTTP/1.1
>
> Host: my.site.com
>
> User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.4) Gecko/20100417
>
> Accept: */*
>
> Accept-Language: en-us,en;q=0.5
>
> Accept-Encoding: gzip,deflate
>
> Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
>
> Keep-Alive: 115
>
> Connection: keep-alive
>
> Referer: https://my.site.com/
>
> Cookie: symfony=NMtNSAJp8s7v-SSl6vBGK-jdpr7
>
> Pragma: no-cache
>
> Cache-Control: no-cache
>
>
>
> HTTP/1.1 200 OK
>
> Server: nginx/0.8.35
>
> Date: Wed, 28 Apr 2010 01:46:17 GMT
>
> Content-Type: text/x-js
>
> Connection: keep-alive
>
> Last-Modified: Tue, 27 Apr 2010 18:18:18 GMT
>
> Etag: "362df-c7e-4853beaefee80"
>
> Cache-Control: max-age=259200
>
> Expires: Sat, 01 May 2010 01:46:17 GMT
>
> Content-Length: 3198
>
> X-Varnish: 1825269932 1825269784
>
> Age: 337
>
> Via: 1.1 varnish
>
> ----------------------------------------------------------
>
> https://my.site.com/css/main.css
>
>
>
> GET /css/main.css HTTP/1.1
>
> Host: my.site.com
>
> User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.4) Gecko/20100417
>
> Accept: text/css,*/*;q=0.1
>
> Accept-Language: en-us,en;q=0.5
>
> Accept-Encoding: gzip,deflate
>
> Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
>
> Keep-Alive: 115
>
> Connection: keep-alive
>
> Referer: https://my.site.com/
>
> Cookie: symfony=NMtNSAJp8s7v-SSl6vBGK-jdpr7
>
> Pragma: no-cache
>
> Cache-Control: no-cache
>
>
>
> HTTP/1.1 200 OK
>
> Server: nginx/0.8.35
>
> Date: Wed, 28 Apr 2010 01:46:17 GMT
>
> Content-Type: text/css
>
> Transfer-Encoding: chunked
>
> Connection: keep-alive
>
> Vary: Accept-Encoding
>
> Last-Modified: Tue, 30 Mar 2010 17:05:26 GMT
>
> Etag: "1a8d7-f29-48307a2ca0180"
>
> Cache-Control: max-age=259200
>
> Expires: Sat, 01 May 2010 01:46:17 GMT
>
> X-Varnish: 1825269931
>
> Age: 0
>
> Via: 1.1 varnish
>
> Content-Encoding: gzip
>
> ----------------------------------------------------------
>
> https://my.site.com/apostrophePlugin/images/a-special-blank.gif
>
>
>
> GET /apostrophePlugin/images/a-special-blank.gif HTTP/1.1
>
> Host: my.site.com
>
> User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.4) Gecko/20100417
>
> Accept: image/png,image/*;q=0.8,*/*;q=0.5
>
> Accept-Language: en-us,en;q=0.5
>
> Accept-Encoding: gzip,deflate
>
> Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
>
> Keep-Alive: 115
>
> Connection: keep-alive
>
> Referer: https://my.site.com/
>
> Cookie: symfony=NMtNSAJp8s7v-SSl6vBGK-jdpr7
>
> Pragma: no-cache
>
> Cache-Control: no-cache
>
>
>
> HTTP/1.1 200 OK
>
> Server: nginx/0.8.35
>
> Date: Wed, 28 Apr 2010 01:46:18 GMT
>
> Content-Type: image/gif
>
> Connection: keep-alive
>
> Last-Modified: Tue, 27 Apr 2010 18:18:16 GMT
>
> Etag: "3c20e-31-4853bead16a00"
>
> Cache-Control: max-age=259200
>
> Expires: Sat, 01 May 2010 01:46:18 GMT
>
> Content-Length: 49
>
> X-Varnish: 1825269933 1825269790
>
> Age: 335
>
> Via: 1.1 varnish
>
> ----------------------------------------------------------
>
>
> I'm happy to provide any additional info -- I'm kinda new to digging
> around in caches & headers.  Interesting, nonetheless ...
>
> Thanks,
>
> Ben
>




More information about the varnish-misc mailing list