我正在浏览我最喜欢的网站的HTML … … …我在标记中看到了这一点:
<link href="/Content/all.min.css?d=20090107" rel="stylesheet" type="text/css" />
什么是“?d = 20090107”?我假设它是某种日期,但我不知道为什么它在文件的路径。有任何想法吗?
解决方法@H_403_8@
这就是为文件名添加一些唯一性,所以当他们更改CSS文件时,他们可以更改额外的位,以完全确保每个客户端将重新加载CSS,而不是使用缓存版本。
Web服务器将忽略该参数并正常提供/Content/all.min.css
注意:尽管CSS可能是动态生成的,但这是确保重新加载的常见习语,并且给定参数是日期,似乎很可能。
编辑:Podcast 38提到这个…
We’ve been using the Expires or
Cache-Control Header since we
launched. This saves the browser
round-trips when getting infrequently
changing items,such as images,
javascript,or css. The downside is
that,when you do actually change
these files,you have to remember to
change the filenames. A part of our build process now “tags” these files with a version number so we no longer have to remember to do this manually.
Web服务器将忽略该参数并正常提供/Content/all.min.css
注意:尽管CSS可能是动态生成的,但这是确保重新加载的常见习语,并且给定参数是日期,似乎很可能。
编辑:Podcast 38提到这个…
We’ve been using the Expires or
Cache-Control Header since we
launched. This saves the browser
round-trips when getting infrequently
changing items,such as images,
javascript,or css. The downside is
that,when you do actually change
these files,you have to remember to
change the filenames. A part of our build process now “tags” these files with a version number so we no longer have to remember to do this manually.