Apache配置静态缓存

回复 收藏
浏览器访问www.aaa.com
vi /usr/local/apache2/conf/extra/httpd-vhosts.conf
上面添加如下信息:

          ExpiresActive on
          ExpiresByType image/gif "access plus 1 days"
          ExpiresByType image/jpeg "access plus 24 hours"
          ExpiresByType image/png "access plus 24 hours"
          ExpiresByType text/css "now plus 2 hours"
          ExpiresByType application/x-javascript "now plus 2 hours"
          ExpiresByType application/x-shockwave-flash "now plus 2 hours"
          ExpiresDefault "now plus 0 min"

保存退出
apachectl -t
apachectl graceful
curl -x127.0.0.1:80 'http://www.test.com/static/image/common/logo.png'  -I
2016-03-14 21:36 举报
已邀请:
0

五弊三缺

赞同来自:

学习下思路
0

栋佐

赞同来自:

如果网站的模版和一些图片更换了,需要刷新缓存吗? 怎么刷新?

回复帖子,请先登录注册

退出全屏模式 全屏模式 回复
评分
可选评分理由: