gzip_disable doesn't disable gzip_vary
Maxim Dounin
mdounin at mdounin.ru
Fri Mar 2 12:33:41 UTC 2012
Hello!
On Fri, Mar 02, 2012 at 06:41:50PM +0700, Edho Arief wrote:
> 2012/3/2 Maxim Dounin <mdounin at mdounin.ru>:
> >> Shouldn't there be no change to header at all when client user agent
> >> matches the gzip_disabled (ie. just like with gzip off)?
> >
> > http://tools.ietf.org/html/rfc2616#section-14.44
> >
> > An HTTP/1.1 server SHOULD include a Vary header field with any
> > cacheable response that is subject to server-driven negotiation.
> >
> > For sure with gzip enabled the response "is subject to server-driven
> > negotiation".
> >
>
> So, the "gzip enabled response" includes cases with non-gzip content as:
> - no "Accept-Encoding: gzip,deflate"
> - matches gzip_disabled
> and therefore "Vary: Accept-Encoding" will always be added even though
> the response isn't compressed?
>
> Or in other words, does "gzip on; gzip_vary on" means "add 'Vary:
> Accept-Encoding' header on any responses matching gzip_types
> regardless whether the response actually compressed or not"?
Yes.
Maxim Dounin
More information about the nginx
mailing list