Google-chrome – How to you tell when the browser is retrieving from a cache

browserbrowser-cachefirefoxgoogle-chrome

Is it possible to tell when a browser is retrieving a page from a cache?

I've thought that opening a new tab and directly browsing to the URL would make a fresh pull request from the server, but after testing (in which certain page tailorings weren't changing), it seems that this does not happen.

So is it possible to tell when a browser is pulling something from a cache versus pulling it straight from the web server?

Best Answer

The way I usually tell is to hit CTRL+SHIFT+K, or otherwise open the web debugging console, and watch the "Net" requests as the page loads. If you pay attention to the status codes, you'll see something like

[15:15:26.059] GET http://www.example.com/index.html [HTTP/1.1 304 Not Modified 312ms]

when the cache is used, instead of the normal

[15:15:26.059] GET http://www.example.com/index.html [HTTP/1.1 200 OK 31ms]

And if you want to be really sure that you're not using the cache, hit CTRL+F5 when refreshing.

Related Question