I knew that Google Chrome supports from memory cache
and from disk cache
when I request resources. However, I didn't see from memory cache
before.
How does chrome determine which resources should be cached in memory?
I knew that Google Chrome supports from memory cache
and from disk cache
when I request resources. However, I didn't see from memory cache
before.
How does chrome determine which resources should be cached in memory?
The Chrome browser mostly looks at the cache-control
header from the response header; if this header has immutable
it will store the response to disk. Memory cache is loaded from the RAM so that which is much faster than disk cache & Memory cache is not persisted while close the tab cache will be cleared but disk cache will be retained till that expires. This is one of the primary reasons why browsers have greater memory allotted to them.
You may also need to understand this Memory Cache vs Disk Cache
Refer HTTP Cache chart so that you can easily understand cache flows
The browser inspects the headers of the HTTP response generated by the web server. There are four headers commonly used for caching: ETag
, Cache-Control
, Expires
, Last-Modified
.
A number of factors:
Using this document, the Caching
section in particular, I understand that there are two caches, an on-disk cache and a very fast in-memory cache
.
As for your actual question, how does Chrome decide what gets cached where, I believe the next line provides the answer
The lifetime of an in-memory cache is attached to the lifetime of a render process, which roughly corresponds to a tab
While I am not entirely sure, I believe the in memory cache serves the current tab.