Quote from: pixelchutes at Jul 30, 2007, 02:28 PM
Quote from: sirlancelot at Jul 30, 2007, 12:48 PM
gzcompress() PHP Documentation
Cool. What is the primary difference/benefits opposed to using .htaccess? Never used gzcompress() function myself...
# For servers that support output compression, you should pick up a bit of
# speed but un-commenting the following lines.
php_flag zlib.output_compression On
php_value zlib.output_compression_level 5
I’ve written a rather cool module/plugin/snippet suite for associating external documents (PDF, DOC, XLS, MP3, ZIP, etc) to ANY given MODx document, all with Manager and Web User Permissions out of the box. I hope to prepare a release for community review in the near future.
Now, that said, I was reviewing this thread
http://modxcms.com/forums/index.php/topic,16598.msg105683.html#msg105683 regarding Download scripts and mod_gzip interference...After a quick round of testing I quickly found that the download time of my larger documents was DRAMATICALLY INCREASED by disabling the output compression. I hadn’t realized until now that it was interfering.
In the thread, Jason discusses how to do disable compression using a custom
.htaccess file in the same directory as your download script.
However, because I use MODx for my download handling (the key behind the secure downloading) I don’t have this option, as it would disable compression for the entire site, not just downloads.
It appeared that keeping mod_gzip enabled was no longer going to be an option
...until I recalled this thread!
If my thinking is correct, I should be able to
disable GZip compression in .htaccess (speeding up my downloads/preventing potential errors) but also leverage
gzcompress()
(+ MODx plugin) to compress
only my HTML.
Unfortunately, I wouldn’t obtain the benefit of GZip on my static .JS/.CSS files, unless anyone can think of a way to conditionally turn off mod_gzip based on the HTTP request