Can I disable the cache in Chrome for specific hosts?

58

16

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?

Matt Ball

Posted 2010-12-02T17:10:41.970

Reputation: 3 322

I have the same question, I use johnnycache for FireFox, but something like that for Chrome would be nice

– Wim Deblauwe – 2011-09-30T08:21:11.723

Answers

21

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.

Tim Keating

Posted 2010-12-02T17:10:41.970

Reputation: 743

I never noticed this before, really useful. – Nicholas W – 2012-02-02T12:22:35.240

6another neat hidden chrome feature - When developer tools is open, you can right-click the refresh button for some additional options – Zach Lysobey – 2013-02-05T15:29:09.723

1Alas, in the current version of Chrome, the option now reads "Disable cache (while DevTools is open)". Not so useful anymore. – Kyralessa – 2014-03-10T19:41:56.400

17

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

Posted 2010-12-02T17:10:41.970

Reputation: 13 363

9To be blunt, incognito is even more of a pain than Ctrl-Shift-R. – Matt Ball – 2011-03-17T15:57:24.520

5

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. ;-)

JoshuaDavid

Posted 2010-12-02T17:10:41.970

Reputation: 151

and in this profile, you can configure it to ignore dns caching as well

– Brad Parks – 2015-09-24T12:36:44.947

Good Idea, but the plugin you are linking to is malware... Look at the underscore-1.8.3.js file included as part of the distro. There are chunks of obfuscated code littered throughout the file which contact Dropbox, tracking servers, Yandex.ru, and more. See lines 1660-1870.

This extension is sending your browsing history and more to Russian sources including.

http://api.rtbmediatracker.com https://mc.yandex.ru/watch/26846286?page-url=http%3A%2F%2Fmusicsig.ru%2F

– Rabbi Shuki Gur – 2017-06-22T23:20:00.477

@RabbiShuki Wow, thank you very much, removing the link reference now to the cache-killing plugin. Kol tuv from Cleveland – JoshuaDavid – 2017-06-25T04:57:10.537

4

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.

Micah Røckstår Henning

Posted 2010-12-02T17:10:41.970

Reputation: 179

1Also useful to know. I guess most developers only care about css, js, etc. So that's why it's limited to those. I'm surprised there's no extension... – isaaclw – 2012-08-30T19:00:27.723

In Chrome 26, caching also appears to be disabled even for images. I see 200 OK get requests for all images on every page view. Can anyone else confirm? – NickG – 2013-05-09T12:19:25.840

0

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.

Chunk

Posted 2010-12-02T17:10:41.970

Reputation: 1

0

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

Posted 2010-12-02T17:10:41.970

Reputation: 101

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.

Manuel Alves

Posted 2010-12-02T17:10:41.970

Reputation: 111

Link leads to a 404. – Phil – 2018-06-28T21:42:56.017

1Are you associated with this project in any way? Why do you recommend it? It may be a great tool, but if you include what it does as well as pros/cons in your answer, it will add value to your answer. – Raystafarian – 2013-07-22T10:39:44.163