Skip to content Skip to sidebar Skip to footer

Iframe Reload Caching Issue

I am executing the following code in an iFrame: window.frames[0].location.reload(); It reloads the page, however, it looks like SOMETIMES the data is cached. I found the source o

Solution 1:

Something like:

var fl = window.frames[0].location;
var href = fl.protocol + '//' + fl.host + fl.pathname + '?random=' + Math.random() + fl.hash;
window.frames[0].location.href = href;

Of course, if you need to preserve "search" parameters, then you will need to add some logic to determine how to add the random parameter.

Post a Comment for "Iframe Reload Caching Issue"