使用Apache设置缓存控制最大年龄不起作用
我正在尝试为我的网站设置HTTP缓存。以下是我的配置设置使用Apache设置缓存控制最大年龄不起作用,apache,caching,http-caching,Apache,Caching,Http Caching,我正在尝试为我的网站设置HTTP缓存。以下是我的配置设置 # 1 YEAR <FilesMatch "\.(ico|svg|woff|eot|ttf)$"> Header set Cache-Control "max-age=31536000, public" </FilesMatch> # 1 WEEK <FilesMatch "\.(jpg|png|gif|css|js)$"> Header set Cache-Control "max-age=6048
# 1 YEAR
<FilesMatch "\.(ico|svg|woff|eot|ttf)$">
Header set Cache-Control "max-age=31536000, public"
</FilesMatch>
# 1 WEEK
<FilesMatch "\.(jpg|png|gif|css|js)$">
Header set Cache-Control "max-age=604800, public"
</FilesMatch>
为什么没有缓存控制最大年龄标头标记
我还使用了检查,它仍然说没有为所有文件指定过期时间
我遗漏了什么吗?由于我的
apache2.conf
文件中缺少一些配置设置,因此未考虑.htaccess
文件。在conf文件中进行必要的更改解决了这个问题。对.conf文件的更改是什么?
HTTP/1.1 200 OK
Date: Fri, 12 Sep 2014 09:28:33 GMT
Server: Apache/2.4.7 (Ubuntu)
Last-Modified: Tue, 26 Aug 2014 05:43:32 GMT
ETag: 1409031812.69
Content-Length: 23907
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: image/png