It's not Application Cache's Fault.. Sometimes.
2 min read.
At work we are currently building a mobile web application together with a client. We decided that we would a good idea to use Application Cache for offline mode as well as handling updates when we release new versions of the site.
It’s been a long road and I kind of knew that we would hit roadblocks. But I never thought that they would just keep on coming.
Although, I’ve learnt that it’s not only the App Caches fault. For example, the App Cache might seam to work well in the browser on Windows Phone 8 but if you want to use it in a webview you’re out of luck. If you want to know more about what you can and can’t do with a webview on windows phone, we found this link quite helpful.
Another thing that I found out today was that App cache and the History API doesn’t play nice on iOS 7. Apparently there was a bug introduced in iOS 7 that completely breaks the History API. Nothing gets saved. In our case it meant that we couldn’t use
window.location.go(-1)to traverse backwards in our application. The only solutions seem to be either disabling the Application Cache on iOS 7 or using the actual URLs for the calling pages.
The later solution might seem easy enough for smaller sites, but what do you with larger sites or applications like ours? Well, you kind if end up having to write your own History API all over again.