1

Just being curious, is window.location.reload(true) just clearing the cache for the html page or for all related resources including js files and css as well?

I'm especially thinking of an single page application, where I'd like to ensure that asynchronously loaded parts of the application are served with the latest version. Is asynchronous code loaded from server and its cache cleared as well? (Cache busting is not expected answer!)

If it is just clearing the html page, is it anyhow possible to clear the full cache?

Manuel
  • 9,112
  • 13
  • 70
  • 110
  • It is already answered here http://stackoverflow.com/questions/1011605/clear-the-cache-in-javascript Good luck – Botond Bertalan Mar 28 '17 at 15:49
  • So ... I read this too. Do I interpret the answer "This doesn't clear the whole cache, but has the effect of clearing the cache for the page you are on." if I say it clears all resources loaded by the document? – Manuel Mar 28 '17 at 16:02
  • Clarified question! I'm talking of asynchronous loaded app parts as js bundles. I do see them with a 304 status in chrome's network log. Thus I'm not sure wether they are really clear cached! – Manuel Mar 28 '17 at 16:11
  • 304 means the server was asked whether the resource has changed, so yes it was not taken from cache directly. – Bergi Mar 28 '17 at 16:13
  • The 304 just means it is ignoring its local cache! It does not NOT send a clear cache command to the server like a reload with strg + shift + r does. reload(true) is NOT the same as sending a clearing cache command! – Manuel Mar 28 '17 at 17:46

0 Answers0