0

I am working on a little android app that basically just loads a remote web app in a WebView. This app needs to cater for the device to be offline so the web app as been configured with a cache manifest file. This all works great on a PC (chrome).

My problem is similar to Cache manifest offline app not refreshing javascript files in Chrome , except mine only happens in the WebView on my android device. When I update my Web app and change the manifest file, all html files appear to re-cache correctly but the js files don't, even though they are included in the manifest file exactly the same.

I have tried a number of ways to clear the android application/WebView cache manually (webview.clearCache()/deleting files in cache folder/etc.) but this hasn't helped. Disabling the WebView cache obviously gets the new file but when I re-enable it again I get the old cached files back.

Maybe it is a time based hold on the .js files or something? I really don't know! Any thoughts on this would be greatly appreciated.

Community
  • 1
  • 1

1 Answers1

1

Turns out that the issue was with the site files time to live. This was causing some files to download as new and not others.

In IIS set common HTTP response headers; Expire web content immediately. And I also set up Output Caching for particular file types (.js and .htm) to prevent all caching.

The manifest file still caches as needed but when it needs to change it will actually re-cache the updated files correctly.

The link below talks about a number of "Gotchas" that assisted me ... http://alistapart.com/article/application-cache-is-a-douchebag