By mcload on
I am trying to enable Apache gzip compression to css and js files. Added this to mail folder's .htaccess
php_value zlib.output_compression 16386
AddHandler application/x-httpd-php .css .js
It enabled gzip compression to web pages, however Drupal's css and js were not compressed. "Optimize CSS files" and "Optimize JavaScript files " are enabled in the performance options of Drupal in order to pack them into a single file. I saw that Drupal stores these optimized js and css files to sites/default/files/ folder and this folder has a special htaccess file that prevents my gzip compression commands at the main folder's htaccess. How can I enable compression for these optimized css and js files?
Comments
I don't know about Apache, but here is what I did
In Lighttpd, I just enable mod_compress module and specify the cache folder to store the gzip format of CSS and JS files.
The CSS aggregation on Drupal does not actually work, as I still always have more than one CSS files. And for Minify-ing the JS, I usually use YUI compressor as I noticed once that Drupal does not optimally Minify-ing the JS files.