weewee 发表于 2015-7-13 09:12:15

Apache配置静态缓存

编辑“虚拟主机配置文件”
在CustomLog那一行下面加入文档
<IfModule mod_expires.c>       ## 这里用mod_expires.c模块
       ExpiresActive on
       ExpiresByType image/gif "access plus 1 days"
       ExpiresByType image/jpeg "access plus 24 hours"
       ExpiresByType image/png "access plus 24 hours"
       ExpiresByType test/css "now plus 2 hour"
       ExpiresByType application/x-javascript "now plus 2 hours"
       ExpiresByType application/x-shockwave-flash "now plus 2 hours"
       ExpiresDefault "now plus 0 min"
</IfModule>
红字部分为缓存的时间

# apachectl -t
Syntax OK
# apachectl restart


页: [1]
查看完整版本: Apache配置静态缓存