缓存清单和查询字符串 [英] Cache manifest and query strings
问题描述
我正在调查使用缓存清单。如果我有一个清单,比如:
CACHE MANIFEST
stylesheets / style.css
在页面中,我有一个CSS元素引用 stylesheets / style.css?v = 123
。
缓存清单中的URL和您要调用的URL必须匹配(包括查询)。 b
在您的示例中:
CACHE MANIFEST stylesheets / style.css
in HTML:stylesheets / style.css?v = 123
浏览器总是尝试从服务器获取CSS文件,因为只有无查询CSS文件被缓存本地。在缓存中使用stylesheets / style.css就足够了。
I am investigating using a cache manifest. If I have a manifest such as:
CACHE MANIFEST
stylesheets/style.css
And in the page I have a CSS element referencing stylesheets/style.css?v=123
.
Will the style.css
file be retrieved from the cache or remotely?
The URL in the cache manifest and the URL you're calling must match (INCLUDING the query).
In your example:
CACHE MANIFEST stylesheets/style.css
in HTML: stylesheets/style.css?v=123
The browser will ALWAYS try to fetch the CSS file from the server, since only the query-less CSS file is cached locally. Use of stylesheets/style.css in cache is sufficient.
这篇关于缓存清单和查询字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!