Cache main.js/main.css iOS when saved to Home Screen


I have an ionic2.rc2 app deployed as web only and I’ve noticed that when saved to an iOS home screen, whenever it is launched or navigated to from another app the requests for index.html, main.css & main.js lack the If-Modified-Since header.

Other files like polyfills.js which are also referenced in index.html do have the header.

When using and refreshing in Safari this header is present in all requests.

This leads to the experience being very poor when saved to the home screen compared to just using in Safari


That depends on your web server configuration, not on Ionic.


But it does have that header when using Safari, only when it has been saved to the iOS home screen is it missing, same site/server


Then it probably depends on Safari. In fact looks like it’s been like that for years: (lack of) Caching for iPhone Home Screen Apps.

You could try the application cache, even though it has its downsides.


Correct but I’m pretty confused about the manifest part of AppCache. The project already has a manifest.json referenced in index.html for the app icons, this follows a different structure to the AppCache manifest like in the links you provided and I’m pretty lost on whether they’re the same thing or can coexist somehow.