I am making an app which will support the "Add to Homescreen" features in Android Chrome and iOS Safari. Since I would like universal offline support for both of these features, but I only want to use the manifest file where I have to, in order increase my control. However, iOS Safari does not support service workers, so my question is how can I only instantiate a cache manifest file if support for Service Workers is not present, more specifically; I know I could add manifest='whatever.appcache'
to the <html>
tag with JavaScript, but will browsers, specifically iOS Safari, use that cache?
Asked
Active
Viewed 646 times
3

bren
- 4,176
- 3
- 28
- 43
-
http://stackoverflow.com/a/36727965/3591628 – Daniel Herr Dec 04 '16 at 03:01
-
@DanielHerr Huh, that was useful. Thanks! – bren Dec 04 '16 at 03:38
-
this is an excellent design! (Service Worker with fallback to AppCache) – code_monk Dec 04 '16 at 04:17
-
Thanks @code_monk! – bren Dec 04 '16 at 04:35
1 Answers
5
According to an answer by @Daniel Herr:
You could choose to use Service Workers and AppCache on the same web app. What happens in such a case is that browsers that don’t support Service Workers will use AppCache, and those that do will ignore the AppCache and let the Service Worker take over.
Sources: https://www.w3.org/TR/service-workers/#activation-algorithm, https://crbug.com/410665
Thanks for your answer!

bren
- 4,176
- 3
- 28
- 43