I need to force the browser to reload the previous page from the server when the user presses the back button.
I've added the following to my response headers:
Cache-Control: no-cache, must-revalidate Expires: -1
This seems to work for most browsers but not for Google Chrome that insists on returning the cached results.
So does anyone know how I force the browser to get the page from the server when the user presses the back button?
Thank you.
When you're in Google Chrome, click on View, then select Developer, then Developer Tools. Alternatively, you can right click on a page in Chrome, then click Inspect. Click on the Network tab, then check the box to Disable cache.
Open Google Chrome and navigate to the page you want to test. Press F12 or open developer tools from within Chrome's settings (Settings > More tools > Developer tools). Click the cog in the top right of the pop-out box. Check the "Disable Cache (while DevTools is open)" setting box.
To activate it you have to go to: More Tools > Developer tools > Network "tab" then click on Disable cache.
But you can bypass the cache and force a complete refresh by using some simple hotkeys: Windows and Linux browsers: CTRL + F5. Apple Safari: SHIFT + Reload toolbar button. Chrome and Firefox for Mac: CMD + SHIFT + R.
as per this bug report in chromium repo, users find that using no-store instead of no-cache will fix it in chrome.
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