Force a reload of page in Chrome using Javascript [no cache] Force a reload of page in Chrome using Javascript [no cache] google-chrome google-chrome

Force a reload of page in Chrome using Javascript [no cache]


You can use this hack:

 $.ajax({        url: window.location.href,        headers: {            "Pragma": "no-cache",            "Expires": -1,            "Cache-Control": "no-cache"        }    }).done(function () {        window.location.reload(true);    });


To ensure the page isn't loaded from cache you can add some unique number to query:

window.location = location.href + '?upd=' + 123456;

You also can use date instead of 123456


Great findings! I just encountered the same issue and this really helps a lot!However, in addition to your finding, it seems that Chrome always sends a GET request for location.reload()...IE/FF is repeating the last request instead.