Did you know that browsers will vary their usage of cached items based on user action (e.g. refresh or clicking a link) and resource type (document or asset)?
I ran a little experiment to see how cache behaviour in Chrome varied for the various user actions I could think of: refreshes, hard refreshes, submitting a URL in the address bar, and navigating via a link.
My experiment contained two HTML pages, each with an expiry time so it can be cached by the browser, and each containing assets which also had expiry times for the same purpose. The code for my experiment can be seen on GitHub.
|Refresh – document||n||y|
|Refresh – assets||n||y|
|Hard refresh - document||n||n|
|Hard refresh - assets||n||n|
|Submit URL bar - document||n||y|
|Submit URL bar - assets||y||y|
|Link navigation - document||y||y|
|Link navigation - assets||y||y|
*The browser bypasses the browser cache for assets with valid cache expiry times by setting a request header of