I need to minify my PHP's output in production and from this question it sounds like Gzip is开发者_JAVA技巧 supposed to do the same, with no change in the PHP code. This would be ideal, but I'm using mod_deflate and I still get the full whitespaces; I was under the impression both used the same compression method exactly, that Gzip just added a checksum and headers. Will changing to Gzip actually remove whitespace in served content?
I know Gzip removes the bulk of the size, but due to ab absurdly large form on an intranet application I found minifying the html cuts 2MB off a 5 MB form, and even with deflate on the on-the-wire file size drops 30kb when I minify it in addition to the compression. Is there some setting that is required for this minification, or does Gzip vs Deflate actually matter in this regard? Common knowledge online seemed to indicate deflate was slightly faster so I went with it.
No, it does not. Gzip is a lossless compression, the decompressed document is exactly the same than before compression.
精彩评论