77

I like using Chrome as my everyday browser, as well as for web dev work. I'd like to be able to prevent Chrome from caching anything from localhost (or really, any arbitrary host name) so that I don't have to hard-refresh (Ctrl-Shift-R) all the time.

Is this possible? How?

Hennes
  • 65,804
  • 7
  • 115
  • 169
Matt Ball
  • 3,912

9 Answers9

32

You can't turn off the cache discriminately, but as of v15, you can turn it off completely via a settings panel that you access by clicking the gear button in the lower right corner of the developer tools window. On the network panel of the developer tools, you also have the option to clear cache from the right-click menu with only a confirmation dialog (i.e. it doesn't pop up the preferences tab the way "Clear Browsing Data" does.

Update: looks like this is now a checkbox on the developer tools network tab itself: enter image description here

Tim Keating
  • 1,053
20

This is already possible if you switch to Incognito mode for that site/host.

Ctrl + Shift + N

Viewing a site in Incognito mode should give you a clean slate void of any cached items and images.

If you're in a session, then it will reset it for you too. So you may want to watch for that when developing.

But if you really need to disable it on a per-site basis, then no. It's not currently possible.

random
  • 15,201
7

Disabling the cache from the developer tools settings in Google Chrome does not prevent caching of images, I've noticed. It only disables caching of CSS, JavaScript, and markup. Incognito mode is likely the most effective way of ensuring you're dealing with an uncached webpage.

7

Why not use Chrome profiles (aka "users")?

Configure one to be your "dev" profile (with no caching). You can enable a cache-killing plugin. You can disable cookies too. When it's time for a dev session, use that profile. Then when it's time to chill simply switch the profile back. All profiles can be run simultaneously.

This is also SUPER handy for testing purposes.

Assigning shortcuts and keyboard shortcuts to switch back-and-forth is icing on the cake.

Now if you really want to be slick you could have multiple user profiles for different projects/environments all at once (i.e., one for JS, one for server-side, etc... multiple monitors a must). Better use the superuser icon if this is you. ;-)

1

Take a look at Super-Cache chrome extension which allows to customize caching policy per host

From docs: Override caching policy that has been set on the server. Select a host on which the caching is required and all requests from a page with that host will be cached.

pymen
  • 111
0

I don't know of a direct way, but you can download the Super-Cache Chrome extension and then go to its permissions page. There, you can change its Site Access to On specific sites and enter a list of sites for it to disable cache for, and the rest will remain untouched. To make the extension block all caching on those sites, you also have to click on its icon and change everything to No store, then save.


Site settings for Super-Cache

0

Take a look at Chrome Cache Killer extension.

This extension automatically clears your browser cache before loading a page. Can be enabled/disabled with a mouse click.

It works very well and solved me lots of headaches when developing web sites since Chrome keyboard shortcuts to clear the cache don't seem to work very well. I found it when looking for a solution to Chrome cache problems.

-1

This option works if you own the website (in which case you're probably updating the same page a lot which causes it to cache).

<meta name="robots" content="noarchive">

Add this string of code to your <head> and it should do the trick.

-1

I use this chrome extension. Note u will have to go into the extension options first and add the URL of the site you want to disable cache on.

Extension Link - https://chrome.google.com/webstore/detail/no-cache/ogbfmfambmmhfdpfokohebghmcdbodbh