Warning: include(/home/sub1idc/public_html/lunarpages.ac.cn/wp-content/plugins/wp-super-cache/wp-cache-base.php): failed to open stream: No such file or directory in /www/wwwroot/lunarpages.ac.cn/wp-content/plugins/wp-super-cache/wp-cache.php on line 53

Warning: include(): Failed opening '/home/sub1idc/public_html/lunarpages.ac.cn/wp-content/plugins/wp-super-cache/wp-cache-base.php' for inclusion (include_path='.:/www/server/php/56/lib/php') in /www/wwwroot/lunarpages.ac.cn/wp-content/plugins/wp-super-cache/wp-cache.php on line 53

Warning: include_once(/home/sub1idc/public_html/lunarpages.ac.cn/wp-content/plugins/wp-super-cache/ossdl-cdn.php): failed to open stream: No such file or directory in /www/wwwroot/lunarpages.ac.cn/wp-content/plugins/wp-super-cache/wp-cache.php on line 70

Warning: include_once(): Failed opening '/home/sub1idc/public_html/lunarpages.ac.cn/wp-content/plugins/wp-super-cache/ossdl-cdn.php' for inclusion (include_path='.:/www/server/php/56/lib/php') in /www/wwwroot/lunarpages.ac.cn/wp-content/plugins/wp-super-cache/wp-cache.php on line 70
LunarPages主机如何实现Gzip压缩 | LunarPages中文导航

LunarPages主机如何实现Gzip压缩

      在LunarPages虚拟主机中启用Gzip可以将文件压缩到原来的约1/4,也就是速度可以提高到原来的4倍,使用流量将减少到原来的1/4。

      启用Gzip压缩需要设置以下两个步骤:

1.首先给所有的php文件启用gip压缩:

在php.ini中添加下面语句:

output_buffering = Off

output_handler =

zlib.output_compression = On

这样就可以给所有php文件进行gzip压缩了。

2.下面为html页面启用gzip压缩,这里要做的就是让apache将html文件当作php文件处理即可,在.htaccess文件中加入下面的语句即可:

AddHandler x-httpd-php .html .htm

这样就可以为html文件htm文件启用gzip压缩了。

版权声明: LunarPages中文导航(https://lunarpages.ac.cn/)版权所有
原文地址 https://lunarpages.ac.cn/lunarpages-gzip/

了解更多美国虚拟主机的资讯信息请去美国主机侦探,代购美国主机请Q:800013301

评论已关闭.