Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between a primed cache and empty cache?

Tags:

html

browser

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?

like image 939
jchvelacso Avatar asked Oct 03 '11 03:10

jchvelacso


People also ask

What does priming the cache mean?

To prime caches means to fill the caches with data so that subsequent Directory Server behavior reflects normal operational performance, rather than ramp-up performance. Priming caches is useful for arriving at reproducible results when benchmarking, and for measuring and analyzing potential optimizations.

What does empty cache do?

Clearing your cache only gets rid of the data your device has stored from the websites and apps you visit—it has no impact on your photos or the files you have saved there. Regardless of the device, your photos are safe when you clear your cache.

Is it good to clear cache?

Your apps and web browser store bits of information to speed up your experience using them. Over time, your phone may collect a lot of files you don't really need. You can clear out the files to free up a little storage space on your device. Clearing cache can also help with website behavior issues.

What is the difference between clearing cache and cookies?

Cookies are files created by sites you visit. They make your online experience easier by saving browsing data. The cache remembers parts of pages, like images, to help them open faster during your next visit.


2 Answers

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)

like image 160
Matthew Flaschen Avatar answered Sep 20 '22 17:09

Matthew Flaschen


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

like image 43
themhz Avatar answered Sep 16 '22 17:09

themhz