已填充的缓存和空缓存有什么区别?
已填充的缓存和空缓存有什么区别?
例如,YSlow 的统计结果提供了空缓存与已填充缓存的图形数据。它们之间有什么区别?
What is the difference between a primed cache and empty cache?
For example the statistics result of YSlow provides a graphical data of an empty cached vs. primed cache. What are the difference between them?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
简单地说,已准备好的缓存意味着浏览器已对其进行缓存。它以前就存在过,或者(虽然我不认为 YSlow 是这个意思)它曾经存在于使用一些相同资源(图像、CSS、JavaScript)的地方
Simply, a primed cache means the browser has it cached. It has been there before, or (though I don't think YSlow means it this way) it has been somewhere that uses some of the same resources (images, CSS, JavaScript)
这是三年前被问到的,但我自己也遇到了这个问题,因为我不得不这样做。所以我在互联网上做了一个小研究,我发现:
“统计”是第三个选项卡,提供了对服务器发出的 HTTP 请求数量以及空缓存和已填充缓存的页面总权重(以千字节为单位)的图形表示场景。
Empty Cache 场景是当浏览器向页面发出第一个请求时,Primed Cache 场景是当浏览器向页面发出第一个请求时有该页面的缓存版本。在Primed Cache场景中,组件已经在缓存中,因此这将减少HTTP请求的数量,从而减少页面的权重。
这里的关键词是“场景”。这并不意味着如果您已经缓存了页面,图表将会发生变化。即使我缓存了它,我也运行测试两次,并且它总是显示两个图表,因为它显示了“场景”。因此,如果我缓存了页面,我会看到“已准备好缓存”场景,但对于新访问者来说,会看到“空缓存”。
所以在上面的例子中,当我请求页面并且它被缓存时,我的浏览器仍然会发出3个请求,总权重为86.6K
。这个页面解释了yslow实际显示的内容。 http://www.devcurry.com/2010/07/understanding -yslow-firebug-extension.html
This was asked 3 years before, but I bumped into this question my self since I had it to. So I did a small research on the internet and I found that :
Statistics is the third tab and provides a graphical representation of the number of HTTP requests made to the server and the total weight of the page in kilobytes for both Empty Cache and Primed Cache scenarios.
The Empty Cache scenario is when the browser makes the first request to the page and the Primed Cache scenario is when the browser has a cached version of the page. In a Primed Cache scenario, the components are already in the cache, so this will reduce the number of HTTP requests and thereby the weight of the page.
Keyword here is "scenarios". This does not mean that the graphs will change if you already have cached the page. I run the test two times even though I cached it and it always displays both graphs since it shows the "scenarios". So if I cached the page I am looking at the Primed Cache scenario but for my new visitors the Empty Cache.
So in the above example, when I request the page and it is cached, my browser will still make 3 requests with total weight of 86.6K
This page explains what actually yslow displays. http://www.devcurry.com/2010/07/understanding-yslow-firebug-extension.html