Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 .woff 文件,无论我的 VCL 配置如何,Varnish 都会对其进行点击。这种文件类型有什么东西会阻止它被缓存吗?
我正在使用 Varnish 4.1.3、Ubuntu 14.04.2 LTS 和 Apache 2.4.7。
您必须让 Apache 为 Varnish 发送正确的 Expires 标头来缓存这些字体文件。更改您的 Apache 配置/.htaccess:
为字体文件添加正确的 MIME 类型:
AddType application/font-woff woff
指定您希望 Varnish 缓存这些的最大过期时间:
ExpiresByType application/font-woff "access plus 1 month"