Deflated content if double-compressed when the server is set to compress output

aozz

New Member
#1
Deflated content is double-compressed when the server is set to compress output

LiteSpeed Web Server/Standard/3.3.23
CentOS 3.9 32-bit
PHP 4.4.8

When compressing content in PHP using gzdeflate() and setting the proper header "Content-Encoding deflate", the content ends up double-compressed if the server is set to compress output too. It works well when using gzip in PHP.

Seems that LiteSpeed disregards the "Content-Encoding deflate" header.
 
Last edited:

aozz

New Member
#3
Why? Deflate is faster and uses a little less server resources. It's also supported in all newer browsers very well (HTTP 1.1). Gzip uses deflate internally but adds CRC32 checksum at the end, so there's almost no difference in the size of the compressed file.

Most web servers when configured to compress output on the fly seem to handle PHP compressed files properly, both deflated and gzipped.
 
Top