0

Css 文件是从缓存中挑选出来的,所以我必须手动编辑文件版本style.css?v=2,例如强制缓存重置。

在我的电脑上一切正常,但很多人告诉他们,他们有旧版的 css 文件中的旧标志或旧设计。这意味着它们是从缓存中获取的。

如何通过 nginx 解决这个问题?

我已经在考虑将修改时间动态附加到所有 css 文件的解决方案style.css?v=%last file modify time%

我的 nginx conf 中唯一的缓存是这一行:

expires 1y;
4

1 回答 1

0

When modified is omitted expires will allow the browser to cache a file based on the request time. Read the mod_header documentation for all the details.

于 2013-05-02T16:57:16.437 回答