码迷,mamicode.com
首页 > Web开发 > 详细

Apache配置静态缓存

时间:2015-07-11 18:47:23      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:虚拟主机   access   配置文件   

编辑“虚拟主机配置文件”

在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>

红字部分为缓存的时间

[root@LAMPLINUX ~]# apachectl -t

Syntax OK

[root@LAMPLINUX ~]# apachectl restart



Apache配置静态缓存

标签:虚拟主机   access   配置文件   

原文地址:http://286577399.blog.51cto.com/10467610/1673206

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!