How to stop a Safari iOS webpage from loading cached pages after adding to the home screen?

I added the site to the main screen of iOS. If the download opens a website from the iOS home screen, it seems to always load the cached page. Even if I refresh the page or delete the page completely, it still loads the original version.

It will load the updated page if I open the site directly from iOS Safari, and not by clicking the icon on the main screen.

The site is hosted on Apache under the control of Ubuntu 11.10.

I added the following inside

and added

to make it load the updated page.

I also tried clearing the cache and cookies and history from Safari settings from iOS, as well as restarting the ipad and nothing works.

Please help ~!

+3
1

, , .

<script>
    var url = window.location.href;
    if (url.indexOf('rnd=') == -1) {
        url = (url.indexOf("?") == -1 ? url + "?rnd=" : url + "&rnd=") + Math.random();
        window.location.href = url;
    }
</script>

, http://mysite.com/myCoolPage.html iOS, , , http://mysite.com/myCoolPage.html?rnd=xxxxxxx, .

+2

All Articles