gzip apache_使用Apache GZIP压缩加快网站速度

gzip apache

We can speed up the site with compression while save bandwidth at the same time. As most of the modern browsers support gzip encoding, we can set it up to let the users enjoy faster speed. The Apache mod_deflate is easy to set up and standard. It compress the content on the fly.

我们可以通过压缩来加速站点,同时节省带宽。 由于大多数现代浏览器都支持gzip编码,因此我们可以对其进行设置以使用户享受更快的速度。 Apache mod_deflate易于设置和标准化。 它动态压缩内容。

We can enable output compression in Apache by adding the following into the .htaccess file in the root directory of the website:

通过将以下内容添加到网站根目录中的.htaccess文件中,我们可以在Apache中启用输出压缩:

# Compress html, text, javascript, css and xml content:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE text/x-javascript

If the .htaccess file can’t be edited or the mode isn’t enabled, there is another alternative solution for php supported environment:

如果.htaccess文件无法编辑或未启用该模式,则可以使用另一种替代方法来解决php支持的环境:

Speeding Up the Site by Using PHP GZIP Compression

通过使用PHP GZIP压缩来加速站点

翻译自: https://www.systutorials.com/speeding-up-the-site-with-apache-gzip-compression/

gzip apache

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值