How to enable GZip compression in XAMPP server(如何在 XAMPP 服务器中启用 GZip 压缩)
问题描述
我正在使用 xampp 服务器最新版本来提高我的网页性能.
I am using xampp sever latest version to improve my web page performance.
我必须在 XAMPP 中启用 Gzip.怎么办?
I have to enable Gzip in XAMPP. How can it be done?
推荐答案
您可以通过在 apache 中设置适当的指令来进行压缩.
You do compression by setting appropriate directive in apache.
它会取消注释 apache conf 文件中的以下行:C:xamppapacheconfhttpd.conf
It goes uncommenting the following lines in your apache conf file: C:xamppapacheconfhttpd.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>
这篇关于如何在 XAMPP 服务器中启用 GZip 压缩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 XAMPP 服务器中启用 GZip 压缩
基础教程推荐
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 如何替换eregi() 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
