According to this API doc, which is the only source I've found which describes the in-memory cache:
Chrome employs two caches — an on-disk cache and a very fast in-memory cache. The lifetime of an in-memory cache is attached to the lifetime of a render process, which roughly corresponds to a tab. Requests that are answered from the in-memory cache are invisible to the web request API. If a request handler changes its behavior (for example, the behavior according to which requests are blocked), a simple page refresh might not respect this changed behavior. To make sure the behavior change goes through, call handlerBehaviorChanged() to flush the in-memory cache. But don't do it often; flushing the cache is a very expensive operation. You don't need to call handlerBehaviorChanged() after registering or unregistering an event listener.
I need a better understanding of the in-memory cache. Specifically, I need Chrome to generate the full webRequest / resource waterfall every time I visit a site, including refreshing a page. Obviously, this can't be true if it's using an in-memory cache.
Is the memory cache a clean-slate for a new tab when I create a new tab?
What does "very expensive operation" mean quantitatively?
If I call handlerBehaviorChanged() every time a page is reloaded in the same tab, will that guarantee a full waterfall? In that case, a limit of 20 times over 10 minutes seems fairly low.
Any help is highly appreciated, thanks!
"Memory Cache" stores and loads resources to and from Memory (RAM). So this is much faster but it is non-persistent. Content is available until you close the Browser. "Disk Cache" is persistent. Cached resources are stored and loaded to and from disk.
In the Chrome appAt the top, choose a time range. To delete everything, select All time. Next to “Cookies and site data” and “Cached images and files,” check the boxes. Tap Clear data.
In your case I think that your problem is with the long term cache instead the in-memory cache. In the resource waterfall several requests can be marked as cached. There are various manners to avoid that if you want:
Remember to apply these rules only for the resources that you really need to. Otherwise your webserver will be overloaded with innecesary requests.
As stated in the document mentioned: in-memory cache does not apply to different page renderings even for the same url and in the same tab (in-memory cache is attached to the lifetime of a render process), so I think that does not apply for your case. Rendering cycle ends each time the page is displayed and a different one starts if rendered again. For example: when a image is loaded for the first time appears in the waterfall, but no for later requests on the same page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With