Disabling Chrome cache for website development

后端 未结 30 1577
-上瘾入骨i
-上瘾入骨i 2020-11-21 06:49

I am modifying a site\'s appearance (CSS modifications) but can\'t see the result on Chrome because of annoying persistent cache. I tried Shift+refresh but it doe

相关标签:
30条回答
  • 2020-11-21 07:00

    Using Ctrl+Shift+R to refresh was nice but didn't get everything I needed. still some things wouldn't refresh, such as data stored in js and css. found a solution: a toolbar of google for chrome web developers. After you install the toolbar select options and "reset page".

    0 讨论(0)
  • 2020-11-21 07:00

    This might help someone.

    I have rigged my Nginx for crazy caching. Thus, disabling cache in network tools and explicitly clearing cache don't work.

    A very simple yet boring workaround is, I just open a new Incognito Tab. Surprisingly it works, all the time!

    A hard refresh in incognito mode does the trick anytime I wish to reload in the same mode.

    0 讨论(0)
  • 2020-11-21 07:03

    Picture of reload menu

    1. Pull up the Chrome developer console by pressing F12 and then (with the console open):

    2. Right click (or hold left click) on the reload button at the top of the browser and select "Empty Cache and Hard Reload."

    This will go beyond "Hard Reload" to empty the cache entirely, ensuring that anything downloaded via javascript or etc. will also avoid using the cache. You don't have to mess with settings or anything, it's a quick 1-shot solution.

    0 讨论(0)
  • 2020-11-21 07:03

    In addition to the disable cache option (which you get to via a button in the lower right corner of the developer tools window -- Tools | Developer Tools, or Ctrl + Shift + I), on the network pane of the developer tools you can now right click and choose "Clear Cache" from the popup menu.

    0 讨论(0)
  • 2020-11-21 07:03

    How about a bookmarklet which changes the page name to prevent the page from cacheing. In Chrome you would create a new bookmark and then paste the code into the URL. Click the bookmark and the page will reload with timestamp to thwart the cache.

    javascript:(function(){var idx = location.href.indexOf('?');var d = new Date();var str = location.href.substr(0,idx) + '?version=' + d.getTime();location.href=str; void 0;})();
    
    0 讨论(0)
  • 2020-11-21 07:05

    enter image description here

    Clearing the cache is too annoying when you need to clear the cache 30 times an hour.. so I installed a Chrome Extension called Classic Cache Killer that clears the cache on every page load.

    Chrome Store Link (free) (Now without malware!)

    Now my mock json, javascript, css, html and data refreshes every time on every page load.

    I never have to worry if I need to clear my cache.

    There are about 20 cache cleaners for Chrome I found, but this one seemed lightweight and zero effort. In an update, Cache Killer can now stay "always on".

    Note: I do not know the plugin author in any way. I just found it useful.

    0 讨论(0)
提交回复
热议问题