How to enable GZip compression in XAMPP server

user855287 picture user855287 · Aug 9, 2011 · Viewed 35.2k times · Source

I am using xampp sever latest version to improve my web page performance.

I have to enable Gzip in XAMPP. How can it be done?

Answer

linuxeasy picture linuxeasy · Aug 9, 2011

You do compression by setting appropriate directive in apache.

It goes uncommenting the following lines in your apache conf file: C:\xampp\apache\conf\httpd.conf

if your xampp installation folder is C:\xampp.

and these are the lines to be uncommented first:

LoadModule headers_module modules/mod_deflate.so
LoadModule filter_module modules/mod_filter.so

that is to say, if they have # before them, you should remove them!

Then put this at the end of your httpd.conf file:

SetOutputFilter DEFLATE 

<Directory "C:/your-server-root/manual">  #any path to which you wish to apply gzip compression to!
    <IfModule mod_deflate.c>
        AddOutputFilterByType DEFLATE text/html  # or any file type you wish
    </IfModule>
</Directory>