apache添加mod_expires,并设置客户端缓存1年图片和flv

前提:apache安装前支持DSO动态模块加载
安装mod_expires
cd httpd-2.2.6/modules/metadata/
/usr/local/apache/bin/apxs -c -i -a mod_expires.c
在httpd.conf中添加
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 12 month"
ExpiresByType text/html "access plus 12 months"
ExpiresByType text/css "access plus 12 months"
ExpiresByType image/gif "access plus 12 months"
ExpiresByType image/jpeg "access plus 12 months"
ExpiresByType image/jpg "access plus 12 months"
ExpiresByType image/png "access plus 12 months"
EXpiresByType application/x-shockwave-flash "access plus 12 months"
EXpiresByType application/x-javascript      "access plus 12 months"
ExpiresByType video/x-flv "access plus 12 months"
</IfModule>
具体细节参考apache手册
 
文章来自 http://www.secblog.cn/show-170-1.html

你可能感兴趣的:(apache,职场,mod_expires,休闲,客户端缓存)