Skip to content

Instantly share code, notes, and snippets.

@alexdevero
Forked from akashnimare/clear-cache.js
Created February 24, 2018 12:08
Show Gist options
  • Save alexdevero/6d9ae389134fbad7561de6e1a16aab39 to your computer and use it in GitHub Desktop.
Save alexdevero/6d9ae389134fbad7561de6e1a16aab39 to your computer and use it in GitHub Desktop.
Clear cach in electron
const {BrowserWindow} = require('electron');
const win = BrowserWindow.getAllWindows()[0];
const ses = win.webContents.session;
ses.clearCache(() => {
alert("Cache cleared!");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment