【发布时间】:2015-09-22 17:53:25
【问题描述】:
我使用 Chrome 的审核功能试图找出我网站中的一些性能瓶颈。我发现了很多关于不可缓存资源的报告。
我对一个包含库中样式表的单页进行了试运行,发现了同样的事情:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html" >
<h:head>
<h:outputStylesheet library="default" name="style.css"/>
</h:head>
<h:body>
<div><h:outputText value="test"/></div>
</h:body>
</html>
这是审核日志条目:
The following resources are explicitly non-cacheable. Consider making them cacheable if possible:
style.css.jsf
有趣的是,如果我将它从库中删除,这条消息就会消失。因此,在库中缓存资源似乎存在问题。
有没有办法解决这个问题?
编辑:根据此答案中的一个 cmets,如果在页面上执行正常刷新,可能不会缓存 CSS:Set HTTP headers properly to force caching on JS, CSS and PNG files
可以吗?为什么书签或输入的 URL 不能重新使用缓存的副本?
【问题讨论】:
标签: css jsf google-chrome-devtools http-caching