title: Trying to clear cache in Electron but it doesn't seem to work
body: <p><strong>Context:</strong> Adding a feature to an <code>Electron</code> app to check license data, etc. on start up by sending a query string using <code>XMLHttpRequest</code> to a remote server. In my testing rig, after a fresh launch an initial request will take 3-4 seconds but subsequent requests return immediately. That worries me.</p>
  
  <p>So a caching issue? I haven't done much network stuff but searching around I saw this (<a href="https://stackoverflow.com/questions/31446782/how-to-clear-the-cache-data-in-electronatom-shell">How to clear the cache data in Electron(atom shell)?</a>). Alas, it does not seem to make a difference. I have also tried adding a timestamp to the end of the query string to try to force a new request. </p>
  
  <p>Am I doing something obviously wrong? I've upgraded to the latest version of Electron and have seen no difference. </p>
  
  <hr>
  
  <pre><code>function clearCache() {
    var win = remote.getCurrentWindow();
  
    win.webContents.session.clearStorageData(null, () =&gt; {
      // this NEVER gets called
       console.log('session cleared');
    });
  
    win.webContents.session.clearCache(function () {
      // this DOES get called
      console.log('cache cleared', (new Date()).getTime());
    });
  }
  </code></pre>
  
  <hr>
  
  <pre><code>  // attempt to force new request
      var timestamp = (new Date()).getTime();
      obj.timestamp = timestamp;
  
      var url = domain + queryString.stringify(obj);
  
      xhttp.open("GET", url);
      xhttp.timeout = 1000 * 30; 
      xhttp.send();
  </code></pre>