已填充的缓存和空缓存有什么区别?

发布于 2024-12-07 10:49:21 字数 74 浏览 0 评论 0原文

已填充的缓存和空缓存有什么区别?

例如,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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

青衫负雪 2024-12-14 10:49:21

简单地说,已准备好的缓存意味着浏览器已对其进行缓存。它以前就存在过,或者(虽然我不认为 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)

稚气少女 2024-12-14 10:49:21

这是三年前被问到的,但我自己也遇到了这个问题,因为我不得不这样做。所以我在互联网上做了一个小研究,我发现:

“统计”是第三个选项卡,提供了对服务器发出的 HTTP 请求数量以及空缓存和已填充缓存的页面总权重(以千字节为单位)的图形表示场景。

yslow stats

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.

yslow statistics

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文