0

我有一个 .woff 文件,无论我的 VCL 配置如何,Varnish 都会对其进行点击。这种文件类型有什么东西会阻止它被缓存吗?

我正在使用 Varnish 4.1.3、Ubuntu 14.04.2 LTS 和 Apache 2.4.7。

4

1 回答 1

1

您必须让 Apache 为 Varnish 发送正确的 Expires 标头来缓存这些字体文件。更改您的 Apache 配置/.htaccess:

  1. 为字体文件添加正确的 MIME 类型:

    AddType application/font-woff woff

  2. 指定您希望 Varnish 缓存这些的最大过期时间:

    ExpiresByType application/font-woff "access plus 1 month"

于 2016-07-21T00:10:28.640 回答