[BULK] Re: Ways to control the gzip_vary directive from nginx 0.6.34 and above?

Zev Blut zblut at cerego.co.jp
Tue Sep 15 16:42:23 MSD 2009


On Sep 15, 2009, at 8:20 PM, Igor Sysoev wrote:

> On Tue, Sep 15, 2009 at 08:04:49PM +0900, Zev Blut wrote:
>
>> On 09/15/2009 07:28 PM, Igor Sysoev wrote:
>>> On Tue, Sep 15, 2009 at 02:05:35PM +0400, Igor Sysoev wrote:
>>>
>>>> On Tue, Sep 15, 2009 at 01:54:53PM +0400, Igor Sysoev wrote:
>>>>
>>>>> On Tue, Sep 15, 2009 at 06:33:38PM +0900, Zev Blut wrote:
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>>
>>>>>> On 09/15/2009 05:23 PM, Igor Sysoev wrote:
>>>>>>> On Tue, Sep 15, 2009 at 04:20:48PM +0900, Zev Blut wrote:
>>>>>>
>>>>>>>> I have attached a debug log from 0.6.39 that has the Vary  
>>>>>>>> when it
>>>>>>>> should
>>>>>>>> not.  If you would like I can also attach a debug log from  
>>>>>>>> 0.6.32 that
>>>>>>>> does not include the Vary (which is what I need).
>>>>>>>
>>>>>>> This bug was fixed in 0.7.9.
>>>>>>> The attached patch fixes it in 0.6.x, if you prefer to stay on  
>>>>>>> this
>>>>>>> version.
>>>>>>
>>>>>> Thank you for the patch!
>>>>>> Unfortunately, it nor does the latest 0.7.62 seem to fix it.
>>>>>> I am still getting the Vary: Accept-Encoding header for non  
>>>>>> gzip stuff.
>>>>>> In both this patch and with 0.7.62
>>>
>>>>> I could not reproduce these responses on 0.8.15, 0.7.62 and  
>>>>> patched
>>>>> 0.6.39.
>>>>> Are you sure that you have no "image/png" in gzip_types ?
>>>>
>>>> Sorry, I missed "gzip_static on": it caused the problem.
>>>
>>> The attached patch fixes this bug on 0.8.15 and 0.7.62.
>>
>> Cool!
>> This seems to work, although now requests from browsers that do not
>> support compression get the Vary header.  This is probably fine for  
>> our CDN.
>>
>>
>> Any chance of getting a patch for 0.6?
>
> The combined patch is attached (including the first one).

Excellent!  This works.

curl -o /dev/null -D - --compress http://localhost:8989/images/sprites/badge.png
HTTP/1.1 200 OK
Server: nginx/0.6.39
Date: Tue, 15 Sep 2009 12:38:11 GMT
Content-Type: image/png
Content-Length: 20031
Last-Modified: Tue, 08 Sep 2009 07:50:52 GMT
Connection: keep-alive
Expires: Wed, 16 Sep 2009 12:38:11 GMT
Cache-Control: max-age=86400
Accept-Ranges: bytes

curl -o /dev/null -D - --compress http://localhost:8989/stylesheets/base2_packaged.css
HTTP/1.1 200 OK
Server: nginx/0.6.39
Date: Tue, 15 Sep 2009 12:38:03 GMT
Content-Type: text/css
Content-Length: 34300
Last-Modified: Tue, 08 Sep 2009 07:51:31 GMT
Connection: keep-alive
Vary: Accept-Encoding
Content-Encoding: gzip
Expires: Wed, 16 Sep 2009 12:38:03 GMT
Cache-Control: max-age=86400


Thanks a lot!

Zev





More information about the nginx mailing list