我想在 IIS 8.5 上为 google 字体指定一个缓存验证器。
http://fonts.googleapis.com/css?family=Open+Sans:400,400italic,300,700,600
我在 web.config 上所做的如下;
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="10.00:00:00" />
</staticContent>
我还通过扩展添加了缓存
<caching>
<profiles>
<add extension=".woff" policy="CacheForTimePeriod" kernelCachePolicy="DontCache" duration="23:59:00" />
<add extension=".ttf" policy="CacheForTimePeriod" kernelCachePolicy="DontCache" duration="23:59:00" />
<add extension=".gif" policy="CacheForTimePeriod" kernelCachePolicy="DontCache" duration="23:59:00" />
<add extension=".js" policy="CacheForTimePeriod" kernelCachePolicy="CacheUntilChange" duration="23:59:00" />
<add extension=".png" policy="CacheForTimePeriod" kernelCachePolicy="DontCache" duration="23:59:00" />
<add extension=".jpg" policy="CacheForTimePeriod" kernelCachePolicy="DontCache" duration="23:59:00" />
<add extension=".css" policy="CacheForTimePeriod" kernelCachePolicy="CacheUntilChange" duration="23:59:00" />
</profiles>
</caching>
但我仍然无法为我使用的 Google 字体应用缓存验证器。我还尝试将静态内容的过期时间设置为例如 2030 年 5 月,但 Google PageSpeed 也没有认识到这一点。* 我已经设法用 .httaccess 做到了,并检查了 stackoverflow 上的 .htaccess 主题。*