Jonathon Posted April 10, 2011 Share Posted April 10, 2011 Hi, I've been using this rule in my .htaccess <IfModule mod_deflate.c> <FilesMatch "\.(js|css)$"> SetOutputFilter DEFLATE </FilesMatch> </IfModule> But It doesn't seem to compress my files. I've diabled the cache to check my site performace but it always say i need to compress my files. I've been fiddling with this for hours, but nothiong seems to actually compress my js + css. Would anyone know why? Link to comment Share on other sites More sharing options...
Larry Posted April 11, 2011 Share Posted April 11, 2011 Just to confirm, WHAT is saying that you need to compress your files? What browsers are you testing this in? On what OS? Can you provide a URL for others to test? Link to comment Share on other sites More sharing options...
Jonathon Posted April 11, 2011 Author Share Posted April 11, 2011 Hi Larry, Thanks for getting back to me. To confirm it was regarding my .js and .css in a .html file. I was using yslow to see how a page i'd written performs. I too chose to disable the etags and then used the above code to compress my files. However: I've just receieved an email form my host. In which they state that they don't enable any kind of apache compression. So it wasn't me (neccessarily). I know I can parse them through php but it was more of a test with my nemesis APACHE! then anything. However I do have another question, you mention that you compress your .php files, how do you do this and subsquently display them on your servers? I'm a little unsure? Link to comment Share on other sites More sharing options...
Larry Posted April 11, 2011 Share Posted April 11, 2011 Compression of PHP scripts is something built into PHP (and enabled or not enabled, depending upon the host). If you're looking to optimize, you may want to consider applying Smush.It to your images. You'll see this linked as part of YSlow! Link to comment Share on other sites More sharing options...
Jonathon Posted April 11, 2011 Author Share Posted April 11, 2011 Ahh thanks Larry, i'll have a play with it now. Link to comment Share on other sites More sharing options...
Recommended Posts