YSlow has suggested that I use HTTP compression to improve the performance of my site. However, as noted by Yahoo that are some problems.
There are known issues with browsers and proxies that may cause a mismatch in what the browser expects and what it receives with regard to compressed content. Fortunately, these edge cases are dwindling as the use of older browsers drops off. The Apache modules help out by adding appropriate Vary response headers automatically.
I understand that the most common problem occurs with IE6 behind a proxy. But how common are these problems today? To quantify it, roughly what percentage of web users experience bugs with HTTP compression?
GZIP provides good enough compression ratio between 2.5 and 3 for text and it is fast, it is fast to compress data and it is fast to deCOM press it.
If you take a file that is 1300 bytes and compress it to 800 bytes, it's still transmitted in that same 1500 byte packet regardless, so you've gained nothing. That being the case, you should restrict the gzip compression to files with a size greater than a single packet, 1400 bytes (1.4KB) is a safe value.
GZip is a form of server-side data compression that's helpful in reducing page loading time. In other words, it takes a set of data and makes it smaller for more streamlined, efficient delivery to a user's computer. Gzip compression reduces the size of your HTML, stylesheets, and JavaScript files.
According to Apache’s recommended example for the use of mod_deflate, the only user agents that lack proper support are:
[…] Netscape Navigator version of 4.x. These versions cannot handle compression of types other than text/html. The versions 4.06, 4.07 and 4.08 also have problems with decompressing html files. Thus, we completely turn off the deflate filter for them.
Any other browser – especially all modern browsers – should support compression properly.
While I don't have statistics on which clients can/can't use compression, I think it's worth noting that with IIS7 the default changed to have Http compression on (for static content), which at least shows how Microsoft feels about the safety of using it. Dynamic content is still disabled, but this is to save CPU cycles more than client compatibility.
Some IIS7 specific data can be found here, although I suspect you would find similar performance characteristics for other web servers.
I make a point to turn on compression on every site. I have yet to have any reported issues.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With