Replace this part:
Code:
function loadIframe() {
var page = pages[(p = ++p % pages.length)], bust = 'bustcache=' + new Date().getTime();
page = page.search? page.href + '&' + bust : page.href + '?' + bust;
document.getElementById('if_one').src = page;
setTimeout(loadIframe, 9000);
}
with:
Code:
var bustdate = new Date().getTime();
setInterval(function(){bustdate = new Date().getTime();}, 1000 * 60 * 5);
function loadIframe() {
var page = pages[(p = ++p % pages.length)], bust = 'bustcache=' + bustdate;
page = page.search? page.href + '&' + bust : page.href + '?' + bust;
document.getElementById('if_one').src = page;
setTimeout(loadIframe, 9000);
}
That way the cache busting query variable will only update every 5 minutes (1000 milliseconds times 60 times 5). The rest of the time the browser can show a cached copy, that is as long as (like I mentioned before) the server isn't serving it with a no cache header. And something I didn't mention is that if the page itself has a meta tag no cache header, that too can force the server to send a fresh copy each time.
But as I also said, as long as this is an intranet, repeated requests to the server (every 9 seconds) shouldn't be a big deal. But it might. Depends on the setup.
Bookmarks