First of all, what is http compression and which module to use for http compression? Compressing data before transmitting to the browsers and then uncompressing the data before displaying. The module that is responsible for http compression i.e. compressing the data is called mod_deflate.The main advantage is that it saves a lot of bandwidth.
On a Plesk server, the mod_deflate module is installed by default, however it may be disabled in the Apache configuration file. To enable the module edit the Apache configuration file
vi /etc/httpd/conf/httpd.conf
Search for the line
#LoadModule deflate_module modules/mod_deflate.so
and uncomment it i.e. remove the ‘#’ mark
LoadModule deflate_module modules/mod_deflate.so
Save the file and restart the httpd service
service httpd restart
Now, create a .conf file under the /etc/httpd/conf.d/ directory since Apache reads all the .conf files from that directory on a Plesk server
vi /etc/httpd/conf.d/deflate.conf
and place the following code in it
<Location />
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URIĀ \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary
</Location>
Save the file and restart the httpd service. The compression code will compress all the files except the .gif, .jpe, .jpeg and .png files. To test the compression, use the tool
http://www.whatsmyip.org/mod_gzip_test/
To enable compression for a specific directory or domain, specify the directory path in the <Location> directive in deflate.conf and restart the Apache server.
Related URLs:
Enable http compression on a Plain Linux server
Tags: compress all files except the images, enable http compression server wide, how to enable httpd compression on a plesk server?, how to load the mod_deflate module in apache configuration?, how to test http compression?, what is http compression?, what is module mod_deflate used for?, what is the module used for http compression?

December 3rd, 2010 at 12:52 pm
You wouldn’t believe the convoluted answers to this question that are floating around the ‘net.
Thanks for this easy and great solution!
February 25th, 2011 at 12:42 pm
Hi!
I have just ordered a Plesk Server (I have never worked with Plesk before). How can I install/load mod_file_cache apache module in Plesk 10?
Thank You.
February 25th, 2011 at 3:42 pm
Hello,
To enable the mod_file_cache, you need to edit the Apache Configuration file at /etc/httpd/conf/httpd.conf and look for the following
#IfModule mod_disk_cache.c>
# CacheEnable disk /
# CacheRoot “/var/cache/mod_proxy”
#/IfModule>
Remove the comments (i.e. #) from the start of every line, save the file and restart the httpd service. That will enable the cache. For more details, refer:
http://httpd.apache.org/docs/2.2/mod/mod_cache.html
May 27th, 2011 at 12:09 pm
another suggestion, use the below deflate.conf instead, because compressing these other types of files will be pointless and wasteful, as well as cause issues…
SetOutputFilter DEFLATE
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$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.avi$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mov$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mp3$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mp4$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.rm$ no-gzip dont-vary
May 31st, 2011 at 6:23 am
Thank you for your suggestion. It will surely help.