教程集 www.jiaochengji.com
教程集 >  服务器技术  >  Lighttpd  >  正文 lighttpd配置压缩文件(mod_compress)

lighttpd配置压缩文件(mod_compress)

发布时间:2014-07-20   编辑:jiaochengji.com
lighttpd配置压缩文件(mod_compress)
在页面中使用gzip可以有效的减低页面的大小,加快网页的下载速度。
在lighttpd中对php页面进行压缩,需要两个步骤:
1. 编辑 lighttpd.conf
复制代码 代码如下:
将 “mod_compress” 设为启用
接着找到
## compress module
在下面加入:
compress.cache-dir = “/var/tmp/lighttpd/cache/”
compress.filetype  = (”text/plain”, “text/html”, “text/css”, “text/javascript”)
做完上面的动作后,基本上 .txt .html .css .js 的文件都会被Gzip压缩了。但php此时还没有压缩。
对于动态的php文件,还需要在php.ini中做相关设置,否则.php页面还是不使用压缩模式。
2. 编辑 php.ini
复制代码 代码如下:
修改
zlib.output_compression = On
zlib.output_handler = On
实现php的压缩,重启Lighttpd,配置生效。
 

您可能感兴趣的文章:

[关闭]
~ ~