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.

The default value for gzip_http_version setting in nginx's gzip module is HTTP 1.1. Why? Is there any problem with using gzip and HTTP 1.0?

share|improve this question

2 Answers 2

It's most probably because HTTP 1.1 is the current version. There is little sense in defaulting to the previous version if the current verison is well adopted.

share|improve this answer
    
This setting does not control what HTTP version is used, it controls whether gzip should be disabled for HTTP 1.0 requests. –  thomasrutter Jan 24 at 0:27

nginx gzip_http_version can have HTTP 1.0 and has it's caveats.

When HTTP version 1.0 is used, the Vary: Accept-Encoding header is not set. As
this can lead to proxy cache corruption, consider adding it with add_header.
Also note that the Content-Length header is not set when using either version.
Keepalives will therefore be impossible with version 1.0, while for 1.1 it is
handled by chunked transfers.  

More here -- http://wiki.nginx.org/HttpGzipModule

share|improve this answer
    
The first sentence has been removed from newer versions of the documentation, so presumably it does now still send the Vary header. But the impossibility of using keep-alive when gzipping on HTTP 1.0 (because the content-length cannot be known prior to output) still exists and there's no way around that. So decide which is worse: HTTP 1.0 clients missing out on gzip, or HTTP 1.0 clients missing out on keep-alive (which often isn't possible for dynamic scripts on HTTP 1.0 anyway). –  thomasrutter Jan 24 at 7:01

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.