简体   繁体   中英

ElectronJS Caching Issue

I am developing a desktop app using ElectronJS. When I make changes to the main html file or any of the javascript files that it calls I am getting a cached version after running the program.

Things I have tried:

  • Opening dev tools on the main electron window, clearing cache and
    clicking 'disable cache'
  • Clearing cache using win.webContents.session.clearCache() in the main process.
  • clearing node cache using npm cache clean --force

Has anyone ever experienced this? Is there a way to disable caching during development?

Selecting Reload from the appropriate menu ( View by default) or calling its keyboard shortcut ( Cmd-R or Ctrl-R or F5 by default) should reload any modified HTML, CSS or JavaScript files used by the renderer process...

In case it's not sufficient, selecting Force Reload may be necessary, provided it is available in the menu; keyboard shortcut is Shift-Cmd-R or Shift-Ctrl-R by default.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM