How to force reloading a page when using browser back button?

You can use pageshow event to handle situation when browser navigates to your page through history traversal: window.addEventListener( “pageshow”, function ( event ) { var historyTraversal = event.persisted || ( typeof window.performance != “undefined” && window.performance.navigation.type === 2 ); if ( historyTraversal ) { // Handle page restore. window.location.reload(); } }); Note that HTTP cache … Read more

What’s the difference between “Normal Reload”, “Hard Reload”, and “Empty Cache and Hard Reload” in Chrome?

Normal reload The same thing as pressing F5. This will use the cache but revalidate everything during page load, looking for “304 Not Modified” responses. If the browser can avoid re-downloading cached JavaScript files, images, text files, etc. then it will. Hard reload Don’t use anything in the cache when making the request. (which is … Read more

Disabling Chrome cache for website development

The Chrome DevTools can disable the cache. Right-click and choose Inspect Element to open the DevTools. Or use one of the following keyboard shortcuts: F12 Control+Shift+i Command+Shift+i Click Network in the toolbar to open the network pane. Check the Disable cache checkbox at the top. Keep in mind, as a tweet from @ChromiumDev stated, this … Read more

How to set HTTP headers (for cache-control)?

To use cache-control in HTML, you use the meta tag, e.g. <meta http-equiv=”Cache-control” content=”public”> The value in the content field is defined as one of the four values below. Some information on the Cache-Control header is as follows HTTP 1.1. Allowed values = PUBLIC | PRIVATE | NO-CACHE | NO-STORE. Public – may be cached … Read more