Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm developing a rails web services with ngnix + passenger, and I use reverse proxy cache in nginx. It works quite well and very fast. The problem is that some clients don't support gzip while some others support.

What I found out is that nginx caches the gzip content, therefore if the gzip-supported clients request first, then the non-gzip clients request, the server still returns gzip content even if the client sends the header "Accept-Encoding": "".

gzip  on;
gzip_http_version 1.0;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/css text/javascript application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss;

Do you have to cache them separately by combining the request_uri and header 'Accept-Encoding'?

share|improve this question
add comment

2 Answers 2

That could be a fixed bug. At least I do not observe the behavior in 0.8.54. Try to upgrade your nginx if it's not the latest.

share|improve this answer
    
I'm using nginx 0.7.67. –  Chamnap Mar 31 '11 at 1:24
    
I'm upgrade to 0.8.54, but the problem still exists. –  Chamnap Mar 31 '11 at 3:38
add comment

You should add $http_accept_encoding to your cache key, or use gunzip module.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.