GZIP compression

By
 In blog

By enabling GZIP compression of the website output is reduced. This allows smaller files are sent to the browser, making the website more quickly comes into focus. At the same time the server load increases slightly. Website output produced is first created smaller, before it is sent to the browser. Usually, the profit is achieved with GZIP compression combined with caching larger than the increase in CPU.
In this article we explain how GZIP compression can access the service panel and how you can handle GZIP compression in your .htaccess file.

Make sure your server has “zlib.output_compression” turned on. If not add zlib.output_compression = On to your php.ini file.

Gzip compression process in your .htaccess file

Not everything needs by GZIP to be further compressed. It is not necessary to further compress compressed files like .zip and .tgz. Please check this by adding the following to your .htaccess file.

<IfModule mod_deflate.c>  
# Insert output filter by type  
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript  
AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/rss+xml  
AddOutputFilterByType DEFLATE application/javascript application/x-javascript  
AddOutputFilterByType DEFLATE application/x-httpd-php  
AddOutputFilterByType DEFLATE application/cgi-php5  
AddOutputFilterByType DEFLATE application/cgi-php53  
AddOutputFilterByType DEFLATE application/cgi-php54  
</IfModule>
# Don't compress images, compressed files, docs nor movies 
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary 
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary 
SetEnvIfNoCase Request_URI \.(?:pdf|doc)$ no-gzip dont-vary 
SetEnvIfNoCase Request_URI \.(?:avi|mov|mp3|mp4|rm)$ no-gzip dont-vary

To use you must also turn on the following line in your .htaccess Zip (now stands for a #):

php_flag zlib.output_compression on

Recent Posts

Leave a Comment