Can I disable the cache in Chrome for specific hosts?

24
2013-08
  • Matt Ball

    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?

  • Answers
  • Tim Keating

    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.

  • random

    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.

  • Micah Røckstår Henning

    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.

  • Manuel Alves

    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.


  • Related Question

    How to force refresh without cache in Google Chrome?
  • Kip

    Does Chrome have an equivalent to Firefox's Ctrl+F5 refresh? I can't seem to find one.

    I changed my gravatar last night, and I can see the new one in Firefox after a Ctrl+F5 refresh, but Chrome seems to be stubbornly hanging on to the old Gravatar. I guess I could manually clear out the cache, but if there is a keyboard command to do it I'd like to know what it is (since it would be helpful for web development too).


  • Related Answers
  • givanse

    Chrome documentation states that Ctrl+F5 or Shift+F5 should do "Reloads your current page, ignoring cached content. "

    If it is not working, you can file a bug report, but it looks like quite a few other people are having the same issue.

    [Existing bug log on this issue] Closed as a duplicate, the issue remmains:

    [Issue: 94090]

  • Arjan

    On a Mac, it's Command-Shift-R, or holding down Shift while clicking the reload button (as opposed to Command-R or a normal click for a regular refresh).

    Some more details:

    For Command-Shift-R, cache is simply ignored and resources are requested like no cache existed.

    For Command-R, Chrome will issue If-Modified-Since requests to the web server, even for things that are actually cached. For most, if not all, content the server should then respond with 304 Not Modified. This is true for most, if not all, modern browsers. The only way to force relying on the cache seems to be clicking a link on the web page, or by following a bookmarked link, or by going into the URL location bar and hitting Return there (Command-L, Return).

    However: a longstanding known issue in Chrome, Chrome Forced Refresh does not ignore cache (and the more recent Reload/Refresh does not refresh), or maybe actually a feature in WebKit, Dynamically inserted subresources aren't revalidated even when the containing document is reloaded, makes Chrome not clear ALL related caches when using the above methods. A Chromium developer explains:

    The network tab of the developer tools show a waterfall of all resources as they are loaded. There are two vertical lines at the right hand side... one of them is labeled "Load event fired" on hover. Anything loading after that point is not officially part of the page (a page can keep issuing requests for hours) [...] so it will NOT be "refreshed" with any combination of f5. This is by design.
    [...]
    Caching [of any resource, before and after the "Load event fired" line] is determined by the HTTP headers of the response, not by the time the request was issued.

    Also note a @ChromiumDev's tweet:

    Chrome DevTools' Disable Cache invalidates the disk cache (great for developing!), but.. only while devtools is visible.

  • Raystafarian

    In the opened developer tools (ctrl+shft+i) in the lower right corner click the little settings icon (it's like a gearwheel).

    Activate Disable cache check-box

  • slhck
    1. Pull up console
    2. Click in right-bottom to cog icon
    3. Tick [General > Disable cache]
    4. Reload page (however)!

  • Daniel Gill

    I have files (images and full html pages) on the server that get updated and no key combination in chrome seems to force fetching them.

    I rely on chrome´s incognito mode - CTRL-SHIFT-N - when I need to force refresh.

    Note that CTRL-R or CTRL-F5 while inside an incognito window doesn´t seem to work either. You must close and reopen the incognito window - hence my reliance on shortcuts - CTRL-W to close, CTRL-SHIFT-N to reopen.

  • jwalker55

    There definitely is no simple way to do this in Chrome like other browsers. The documentation may say that CTRL+F5 or SHIFT+F5 should reload and ignore cache, but it simply doesn't. I have a flash slideshow that stores the settings/configuration in an .xml file, and after updating the XML file, Chrome will still load the cached version unless I purge the cache. I always have to run another browser when updating the slideshow so I don't have to clear my Chrome cache all the time.

  • ring0

    The question is a bit old, but in the recent version of Chrome

    • Right-click the Refresh button, and select Empty cache and Hard reload will bypass the cache and reload the page fully.

    The doc says Ctrl-F5 or Shift-F5 but unfortunately as of today the bug is still not solved :-(

  • J Baron

    Ctrl - Shift - Delete will allow you to remove cache for the previous hour. That will assure that the next time you reload a site it is fresh.

  • Mokubai

    I did this: Right Click the FRAME (that was out of sync), and SHIFT clicked the "Reload Frame" option. The frame then refreshed properly.

  • Diogo

    Definitely a bug in Chrome - it's also images that should be changed, but it uses the old image instead, even after repeatedly hitting Ctrl + F5.

    I was trying to change my Google Apps logo, but the only way it will change on Gmail is if I use incognito mode or clear the entire cache. Ctrl + F5 keeps the old logo.

  • Lord Loh.

    To clear the explicitly specified application cache navigating to chrome://appcache-internals/ on chrome and removing the cache for specific web sites.