Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop chrome from caching

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.

like image 594
Craig Norton Avatar asked Nov 10 '10 16:11

Craig Norton


People also ask

Can I turn off caching in Chrome?

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.

How do I force Chrome to not 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.

How do I stop Chrome from caching localhost?

To activate it you have to go to: More Tools > Developer tools > Network "tab" then click on Disable cache.

How do I force a browser to not 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.


1 Answers

as per this bug report in chromium repo, users find that using no-store instead of no-cache will fix it in chrome.

like image 155
superfro Avatar answered Sep 18 '22 15:09

superfro