How to force Chrome's script debugger to reload javascript?

前端 未结 15 1916
天涯浪人
天涯浪人 2020-12-12 09:56

I really like the ability to edit javascript in the chrome debugger however, I find that it can be really problematic getting the debugger to re-fetch the JavaScript from th

相关标签:
15条回答
  • 2020-12-12 09:57

    If the files which you are loading are cached and if the changes you have made does not reflect in the code then there are 2 ways you can deal with this

    1. Clear the Cache as everyone told

    2. If u want Cache and only the files have to be reloaded , you can go to network tab of the dev tool and clear whatever was loaded. next time it will not load it from cache. you will have your latest changes.

    0 讨论(0)
  • 2020-12-12 09:57

    If you're running a local server on Apache, you can get what look like caching problems. This happened to me when I had a Apache server running under Vagrant (in virtualbox).

    Just add the following lines to your config file (/etc/httpd/conf/httpd.conf or equivalent):

    #Disable image serving for network mounted drive
    EnableSendfile off
    

    Note that it's worth searching through the config file to see if EnableSendfile is set to on anywhere else.

    0 讨论(0)
  • 2020-12-12 10:00

    Here's a shortcut to DevTools:

    1. F12 to open Chrome DevTools
    2. F1 to open DevTools Settings
    3. Check Disable cache (while DevTools is open) as shown below:

    Note: Updated per Dimi's comment. They tend to move it so let me know or update the post if you notice that it's changed.

    0 讨论(0)
  • 2020-12-12 10:00

    For Google chrome it is not Ctrl+F5. It's Shift+F5 to clear the current cache! It works for me !

    0 讨论(0)
  • 2020-12-12 10:00

    There are also 2 (quick) workarounds:

    1. Use incognito mode wile debugging, close the window and reopen it.
    2. Delete your browsing history
    0 讨论(0)
  • 2020-12-12 10:02

    Shift+F5 quickly clears the cache.

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