gzip_disable and vary header

Arvind Jayaprakash work at anomalizer.net
Tue Jun 30 00:07:59 MSD 2009


On Jun 25, Johan Bergström wrote:
> Hello,
>
> On Apr 2, 2009, at 15:48 , Spil Games wrote:
>
>> Hi,
>>
>> A while ago we were having some troubles with gzip and old IE6. I then
>> found this blog entry which seemed to solve my troubles:
>>
>> http://robsanheim.com/2008/02/07/beware-the-default-nginx-config-old-ie6-hates-gzip/
>>
>>
>> However immediately after applying this fix to our Nginx config files I
>> realised that there was still something wrong. If gzip_disable acts on
>> the User-Agent to enable/disable compression, shouldn't gzip_vary act on
>> this too? In other words shouldn't it send this header?:
>>
>> Vary: Accept-Encoding, User-Agent
>
> I've found yet another resource that indicate that the current behavior of 
> nginx is incorrect: http://redbot.org/?uri=http%3A%2F%2Fnginx.net
>
> I can't find what SPEC it is relying on, but as far as other discussions on 
> The Internets go, I think that Accept-encoding is indeed required.

Accept-Encoding most definitely needs to go as part of Vary when gzip in
place. While adding User-Agent to Vary seems tempting, it has a side
effect of severely decreasing your cache-hit ratio since every
build/patch of a browser has a different UA string.





More information about the nginx mailing list