CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Apache configuration (http://www.codingforums.com/forumdisplay.php?f=69)
-   -   Turning on GZip Compression for CSS and JS (http://www.codingforums.com/showthread.php?t=266096)

HDRebel88 06-23-2012 07:47 PM

Turning on GZip Compression for CSS and JS
 
How would I go about turning on GZip for css and js files only, via .htaccess and httpd.config?

Every method I've seem to find ends up de-linking my css files, so I end up with a non-styled site.

I'm running a second domain for all of my static files; that's the domain I've been uploading my .htaccess to.

Here's what I have right now, and according to Google PageSpeed it does nothing:

Code:

Header unset ETag
FileETag None
<filesMatch "(?i)^.*\.(ico|flv|jpg|jpeg|png|gif|js|css)$">
Header unset Last-Modified
Header set Cache-Control "max-age=864000, public"
</filesMatch>

<ifModule mod_deflate.c>
<filesMatch "\.(js|css)$">
SetOutputFilter DEFLATE
</filesMatch>
</ifModule>



All times are GMT +1. The time now is 09:02 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.