57

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?

  • I have the same question, I use johnnycache for FireFox, but something like that for Chrome would be nice – Wim Deblauwe Sep 30 '11 at 8:21
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.

  • I never noticed this before, really useful. – Nicholas W Feb 2 '12 at 12:22
  • 6
    another neat hidden chrome feature - When developer tools is open, you can right-click the refresh button for some additional options – Zach Lysobey Feb 5 '13 at 15:29
  • 1
    Alas, in the current version of Chrome, the option now reads "Disable cache (while DevTools is open)". Not so useful anymore. – Kyralessa Mar 10 '14 at 19:41
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.

  • 6
    To be blunt, incognito is even more of a pain than Ctrl-Shift-R. – Matt Ball Mar 17 '11 at 15:57
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. ;-)

  • and in this profile, you can configure it to ignore dns caching as well – Brad Parks Sep 24 '15 at 12:36
  • 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. api.rtbmediatracker.com mc.yandex.ru/watch/… – Rabbi Shuki Gur Jun 22 '17 at 23:20
  • @RabbiShuki Wow, thank you very much, removing the link reference now to the cache-killing plugin. Kol tuv from Cleveland – JoshuaDavid Jun 25 '17 at 4:57
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.

  • 1
    Also 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 Aug 30 '12 at 19:00
  • 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 May 9 '13 at 12:19
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
    Are 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 Jul 22 '13 at 10:39
  • Link leads to a 404. – Phil Jun 28 '18 at 21:42
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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.