4

I have an application in which I have used app cache. When I change the manifest file and call appcache.update() and call appcache.swap() the new cache is not loaded and previous stuff keeps showing unless i delete the old cache manually and refresh the page.

JS Code:

    window.addEventListener('load', function (e) {
    //window.applicationCache.update();
    window.applicationCache.addEventListener('updateready', function (e) {
        if (window.applicationCache.status == window.applicationCache.UPDATEREADY) {
            // Browser downloaded a new app cache.
            window.applicationCache.update();
            if (confirm('A new version of this site is available. Load it?')) {
                //window.applicationCache.swapCache();
                Application = new PlatformApplication("SuccFuncApp", "ErrFuncApp");
                Application.ClearCache();
                window.location.reload();
                //window.location.href = "http://www.google.com";
            }
        } else {
            // Manifest didn't changed. Nothing new to server.
        }
    }, false);

}, false);

Manifest File:

CACHE MANIFEST
# 2010-06-18:v
test.html
style.css
images/read-more.jpg
images/warning.png
images/confirm.png
images/inner-header.jpg
images/vmoss-logo.png
scripts/jquery-1.9.0.js
scripts/applicationFeature.js
scripts/MobilesPlatform.js

NETWORK:
*
Syed Wajahat Ali
  • 541
  • 1
  • 7
  • 25

1 Answers1

1

Most likely it is your web-servers HTTPs cache control headers

check Offline Web Apps under THE FINE ART OF DEBUGGING

Hebrus
  • 133
  • 6