How to enable GZip compression in XAMPP server

前端 未结 4 1942
说谎
说谎 2021-01-30 11:18

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?

4条回答
  •  囚心锁ツ
    2021-01-30 11:55

    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 
    
      #any path to which you wish to apply gzip compression to!
        
            AddOutputFilterByType DEFLATE text/html  # or any file type you wish
        
     
    

提交回复
热议问题