Compressing is one of those optimizations for a website which can be easily done and still has tremendous effect. Gzip compressing your files results in less bandwidth being used and a lot less data that needs to travel all the way to the impatient client.

gzip compressing is a piece of cake when you can use htaccess. You can put the code below in your .htaccess file:

<Files *.js>

SetOutputFilter DEFLATE

< /Files>


<Files *.css>

SetOutputFilter DEFLATE

< /Files>


This will use an output filter to compress the files. All .js and .css files within the jurisdiction of this .htaccess file will be sent compressed to the client.


React on this article







Enter the code here: