Hiii,
我想在PHP中使用GZIP压缩输出[不包括图像],如何对每种类型的文件[PHP,CSS,JS,HTML]进行压缩
我只知道使用PHP文件的代码。
使用Apache的mod_deflate模块更多信息
http://httpd.apache.org/docs/2.0/mod/mod_deflate.html
http://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression/
将这一行放在页面中任何页眉或其他输出之前。
ob_start("ob_gzhandler");
对于其他文件,您可以通过php提供它们,如果您有mod rewrite,但没有mod deflate或mod gzip