在 IIS 7.5 中,我将 cacheControlMaxAge 设置为一年,就像这样
<location path="Content/Images">
<system.webServer>
<staticContent>
<clientCache cacheControlCustom="public" cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" />
</staticContent>
</system.webServer>
</location>
根据本指南:设置过期和缓存控制:ASP.NET 中静态资源的最大年龄标头
但是,Google PageSpeed 工具仍然说文件没有被缓存:
The following cacheable resources have a short freshness lifetime. Specify an expiration at least one week in the future for the following resources:
* https://local.example.com/Content/Images/image1.png (expiration not specified)
(etc)
为什么它说“未指定到期”?
整个 webapp 都是通过 https 提供的,这是一个因素吗?