如何启用XAMPP服务器的GZip COM pression

问题描述:

我使用的XAMPP断绝最新版本,以提高我的网页性能。

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

我要启用Gzip的XAMPP。如何能做到?

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

您在Apache中设定相应的指令做COM pression。

You do compression by setting appropriate directive in apache.

它去取消注释在Apache的conf文件下面几行:
    C:\\ XAMPP的\\ apache的\\的conf \\ httpd.conf文件

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

如果您的XAMPP安装文件夹为:C:\\ XAMPP

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!

然后把这个在你的httpd.conf文件的末尾:

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>