# Problem with compressing content

**URL:** <https://www.ruby-forum.com/t/problem-with-compressing-content/200858>\
**Category:** NGINX\
**Created:** [December 23, 2010, 11:32am UTC](https://www.ruby-forum.com/t/problem-with-compressing-content/200858 "2010-12-23T11:32:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikuSESS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f17d59/32.png) [@nikuSESS](https://www.ruby-forum.com/u/nikuSESS)\
**Post date:** [December 23, 2010, 11:32am UTC](https://www.ruby-forum.com/t/problem-with-compressing-content/200858/1 "2010-12-23T11:32:12Z")

</div>

My nginx conf:

gzip on;  
gzip\_http\_version 1.0; #if I leave this line out, i am not passing  
GIDZipTest, but firefox is getting gzip if connected outside my company  
LAN  
gzip\_vary on;  
gzip\_comp\_level 1;  
gzip\_proxied any;  
gzip\_types text/html text/css application/x-javascript text/xml  
application/xml application/xml+rss text/javascript  
application/javascript ;

TEST:

curl -I --header ‘accept-encoding:gzip’  
[zagreb-test.12ip.net/stylesheets/base\_packaged.css](http://zagreb-test.12ip.net/stylesheets/base_packaged.css)

HTTP/1.1 200 OK  
Server: nginx/0.7.67  
Date: Thu, 23 Dec 2010 10:03:06 GMT  
Content-Type: text/css  
Connection: keep-alive  
Vary: Accept-Encoding  
Last-Modified: Thu, 23 Dec 2010 06:13:24 GMT  
Expires: Thu, 31 Dec 2037 23:55:55 GMT  
Cache-Control: max-age=315360000  
_Content-Encoding: gzip_

GIDZIPTest : OK

> From my company intranet:

curl -I --header ‘accept-encoding:gzip’  
[zagreb-test.12ip.net/stylesheets/base\_packaged.css](http://zagreb-test.12ip.net/stylesheets/base_packaged.css)  
HTTP/1.1 200 OK  
Via: 1.1 ADSL  
Connection: Keep-Alive  
Proxy-Connection: Keep-Alive  
Content-Length: 42441  
Expires: Thu, 31 Dec 2037 23:55:55 GMT  
Date: Thu, 23 Dec 2010 10:07:38 GMT  
Content-Type: text/css  
Server: nginx/0.7.67  
Vary: Accept-Encoding  
Last-Modified: Thu, 23 Dec 2010 06:13:24 GMT  
Cache-Control: max-age=315360000

There is no Content-Encoing header and .css is not gziped.

To make thing more interesting if I try to fetch googe cdn ui-css(it is  
compressed but I don’t he the gzip in the response)

(from intranet)

curl -I --header ‘accept-encoding:gzip’  
[http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/smoothness/jquery-ui.css](http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/smoothness/jquery-ui.css)  
HTTP/1.1 200 OK  
Via: 1.1 ADSL  
Connection: Keep-Alive  
Proxy-Connection: Keep-Alive  
Content-Length: 27630  
Expires: Thu, 23 Dec 2010 10:10:00 GMT  
Date: Thu, 23 Dec 2010 10:10:00 GMT  
Content-Type: text/css; charset=UTF-8  
Server: sffe  
Last-Modified: Tue, 09 Feb 2010 23:05:02 GMT  
Cache-Control: private, max-age=31536000  
Vary: Accept-Encoding  
X-Content-Type-Options: nosniff  
X-XSS-Protection: 1; mode=block

Any help/pointers would be much appreciated.

Kresimir Bojcic

---

<div class="post-metadata">

**Author:** ![Kresimir\_Bojcic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/dec6dc/32.png) [@Kresimir\_Bojcic](https://www.ruby-forum.com/u/Kresimir_Bojcic)\
**Post date:** [December 23, 2010, 12:09pm UTC](https://www.ruby-forum.com/t/problem-with-compressing-content/200858/2 "2010-12-23T12:09:16Z")

</div>

> HTTP/1.1 200 OK  
> Via: 1.1 ADSL

The Via header suggests you have some kind of proxy in the ‘company  
intranet’ .. it could be possible that it is either stripping gzip  
headers  
or maybe has non-compressed object allready cached and returning it.

rr
