gzip压缩压缩方式压缩率_通过使用PHP GZIP压缩来加速站点

gzip压缩压缩方式压缩率

Compression is a simple way to speed up the site. PHP’s gzip compression is excellent. And using it is very convenient:

压缩是加快站点速度的简单方法。 PHP的gzip压缩非常出色。 并且使用它非常方便:

Simply put these codes before any HTML content at the beginning of the PHP script:

只需将这些代码放在PHP 脚本开头的任何HTML内容之前:

<?php
  if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'))
    ob_start("ob_gzhandler");
  else ob_start();
?>

In WordPress, the suitable position for these codes is the beginning of the header.php file of the theme.

在WordPress中,适合这些代码的位置是theme的header.php文件的开头。

翻译自: https://www.systutorials.com/speeding-up-the-site-by-using-php-gzip-compression/

gzip压缩压缩方式压缩率

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值