首页 > 服务器 > lighttpd配置gzip压缩和设置缓存时间

作者:ghostry 发布时间:2012-11-30 浏览: 3563

转载注明出处: https://blog.1ge.fun/server/lighttpd-pei-zhi-gzip-ya-suo-he-she-zhi-huan-cun-shi-jian.html
server.modules = ( 
	"mod_compress",#压缩用
	"mod_expire",#缓存时间用
)

先调入mod,然后配置

 compress.cache-dir  =  "/mnt/sda2/tmp/",#目录要具有可写权限
	compress.filetype  =  ("text/plain", "text/html", "application/x-javascript", "text/css", "application/javascript", "text/javascript"),#需要压缩的文件类型
	$HTTP["url"] =~ "(\.png|\.css|\.js|\.jpg|\.gif)$" {
		expire.url = ( "" => "access 20 days" ) # 配置静态文件缓存
	}


标签: lighttpd gzip

上一篇: css3设置圆角div
下一篇: 网站建设的一般步骤

添加新评论 »

*
*

欢迎评论!歡迎評論!Comments welcome!komentoj bonvenaj!댓글 오신 것을 환영합니다!
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: :cold: :cryy: :cute: :shy: :sleep: :struggle: :tea: :yahou: