Because a lot of website has implemented caching incorrectly, and caching headers can not always be relied on. A compromise is to re-download the page if a user does a hard refresh of the page, and what exactly defines that? Well, for some browsers it used to be pressing F5
or Ctrl+R
, but simply pressing refresh multiple times might also be enough, because you can not expect users to know about a secret shortcut for a hard refresh – either way, it does not matter much to performance, because users typically do not press refresh unless they actually intend to refresh the page.
Of course, another way is if you check the checkbox that says disable cache in developer tools, causing Chrome to redownload everything, including linked resources; If you remove the checkmark it will instead say the resources were loaded from (memory cache)
when refreshing, meaning they was loaded from the browsers cache in accordance with the cache policy of the resource.
Note. Chrome still shows cached requests in the Network tab, but it will show as loaded from (memory cache)
.
TLS certificate errors can also cause the page not to be cached properly. E.g. If your certificate is self-signed.
Additionally, I can not reproduce the behaviour you mention; that is, only the .html
page itself is refreshed when clicking the refresh button – not the linked resources such as: images, video, JavaScript, or CSS – but it could be a bug specific to your version of Chrome. When I press refresh, even multiple times, resources are still loaded from the browser cache in accordance with my websites cache policy. I verified this by monitoring my server log live while refreshing the page. E.g:
watch tail /var/log/xxx/sitename-access.log