window.location.reload with clear cache

coure2011 picture coure2011 · Apr 19, 2011 · Viewed 353.3k times · Source

I want to reload a page using JavaScript but I want to clear cache too, so on page refresh the page has latest versions of everything from server.
Other browsers except IE are not getting latest content.

Any solution for IE9?

Answer

Christian picture Christian · Apr 19, 2011

reload() is supposed to accept an argument which tells it to do a hard reload, ie, ignoring the cache:

location.reload(true);

I can't vouch for its reliability, you may want to investigate this further.