<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>深度VPS &#187; gzip</title>
	<atom:link href="http://www.deepvps.com/tag/gzip/feed" rel="self" type="application/rss+xml" />
	<link>http://www.deepvps.com</link>
	<description>专注VPS技术，关注前端技术</description>
	<lastBuildDate>Sat, 04 Feb 2023 14:00:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>lighttpd配置gzip和cache</title>
		<link>http://www.deepvps.com/config-lighttpd-with-gzip-and-cache.html</link>
		<comments>http://www.deepvps.com/config-lighttpd-with-gzip-and-cache.html#comments</comments>
		<pubDate>Sat, 01 May 2010 16:04:34 +0000</pubDate>
		<dc:creator>deepvps</dc:creator>
				<category><![CDATA[服务器环境搭建]]></category>
		<category><![CDATA[Cache]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[Lighttpd]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.deepvps.com/?p=415</guid>
		<description><![CDATA[配置gzip主要是使用compress模块

1. 激活compress模块，将lightppd.conf文件的mod_compress的注释去掉
2. 配置压缩文件存放目录compress.cache-dir，注意运行lighttpd的用户需要有这个目录的读写权限，压缩文件的类型compress.filetype
3. 将动态生成的php也gzip，修改php.ini，加上zlib.output_compression = On和zlib.output_handler = On
4. 重启lighttpd

配置cache主要是使用expire模块

1. 激活expire模块，将lightppd.conf文件的mod_expire的注释去掉
2. 配置需要设置过期时间的host
3. 重启lighttpd

最后配置如下：

$HTTP[&#34;host&#34;] =~ &#34;blog.xiaocaihua.com$&#34; {
&#160;
#其他配置...
compress.cache-dir  =  &#34;/home/flymouse/lighttpd/compress/&#34;
compress.filetype  =  (&#34;text/plain&#34;, &#34;text/html&#34;, &#34;application/x-javascript&#34;, &#34;text/css&#34;, &#34;application/javascript&#34;, &#34;text/javascript&#34;)
$HTTP[&#34;url&#34;] =~ &#34;(.png&#124;.css&#124;.js&#124;.jpg&#124;.gif)$&#34; {
expire.url = ( &#34;&#34; =&#38;gt; &#34;access 2 months&#34; ) # 配置静态文件缓存2个月
}
}

最后的Response header应该如下图，有Content-Encoding和Expires，max-age头。

                 http响应的头信息 
参考

1. mod_compress 文档
2. mod_expire 文档

转自 ：小菜花
]]></description>
			<content:encoded><![CDATA[<p>配置gzip主要是使用compress模块</p>
<ol>
<li>1. 激活compress模块，将lightppd.conf文件的mod_compress的注释去掉</li>
<li>2. 配置压缩文件存放目录compress.cache-dir，注意运行lighttpd的用户需要有这个目录的读写权限，压缩文件的类型compress.filetype</li>
<li>3. 将动态生成的php也gzip，修改php.ini，加上zlib.output_compression = On和zlib.output_handler = On</li>
<li>4. 重启lighttpd<span id="more-415"></span></li>
</ol>
<p>配置cache主要是使用expire模块</p>
<ol>
<li>1. 激活expire模块，将lightppd.conf文件的mod_expire的注释去掉</li>
<li>2. 配置需要设置过期时间的host</li>
<li>3. 重启lighttpd</li>
</ol>
<p>最后配置如下：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">$HTTP[&quot;host&quot;] =~ &quot;blog.xiaocaihua.com$&quot; {
&nbsp;
#其他配置...
compress.cache-dir  =  &quot;/home/flymouse/lighttpd/compress/&quot;
compress.filetype  =  (&quot;text/plain&quot;, &quot;text/html&quot;, &quot;application/x-javascript&quot;, &quot;text/css&quot;, &quot;application/javascript&quot;, &quot;text/javascript&quot;)
$HTTP[&quot;url&quot;] =~ &quot;(.png|.css|.js|.jpg|.gif)$&quot; {
expire.url = ( &quot;&quot; =&amp;gt; &quot;access 2 months&quot; ) # 配置静态文件缓存2个月
}
}</pre></div></div>

<p>最后的Response header应该如下图，有Content-Encoding和Expires，max-age头。</p>
<p><a href="http://www.deepvps.com/wp-content/uploads/auto_save_image/2010/05/161017Gzm.png"><img title="http响应的头信息" src="http://www.deepvps.com/wp-content/uploads/auto_save_image/2010/05/161017Gzm.png" alt="http response header info" width="298" height="191" /></a></p>
<p>                 http响应的头信息 </p>
<p>参考</p>
<ol>
<li>1. <a href="http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModCompress" target="_blank">mod_compress 文档</a></li>
<li>2. <a href="http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModExpire" target="_blank">mod_expire 文档</a></li>
</ol>
<p>转自 ：<a href="http://blog.xiaocaihua.com/archives/2010/01/config-lighttpd-with-gzip-and-cache.html" target="_blank">小菜花</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.deepvps.com/config-lighttpd-with-gzip-and-cache.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
