Apache缓存控制失败

时间:2019-01-21 17:02:23

标签: apache

请我急需帮助,我已经使用Expire模块和Header模块(不同时)对某些文件类型(尤其是字体文件)打开了Apache缓存控制。除字体文件外,每个指定的文件都会缓存,我已尽力修复它,但没有运气。有解决此问题的解决方案吗?

过期模块方法

##___________Cache control________________________________________##
# Declare fonts content-type
AddType application/vnd.ms-fontobject .eot
AddType application/x-font-ttf .ttf
AddType application/x-font-opentype .otf
AddType application/x-font-woff .woff
AddType image/svg+xml .svg

ExpiresActive on

ExpiresByType application/x-font-woff "access plus 7200 seconds"
ExpiresByType application/x-font-ttf "access plus 7200 seconds"
ExpiresByType application/vnd.ms-fontobject "access plus 7200 seconds"
ExpiresByType application/svg+xml "access plus 7200 seconds"
Header append Cache-Control "public"
##________________________________________________________________________##

标题模块方法

##___________Cache control________________________________________##
<filesmatch "\.(ttf|jpg|svg|png|jpeg|ico|js)$">
   Header set Cache-Control "max-age=86400, public"
</filesmatch>
##________________________________________________________________________##

输出

output

1 个答案:

答案 0 :(得分:0)

代替此:

The name of the TV is: TV livingroom
Owner 1 is named John Johnson
Owner 2 is named Santa Claus

尝试一下:

    <filesmatch "\.(ttf|jpg|svg|png|jpeg|ico|js)$">
          Header set Cache-Control "max-age=86400, 
          public"
   </filesmatch>