Is Service Worker intended to replace or coexist with Appcache?
Asked Answered
S

3

15

Is ServiceWorker intended to replace Appcache, or is the intention that the two will coexist? Phrased another way, is appcache about to become deprecated?

Sathrum answered 2/2, 2015 at 5:52 Comment(0)
L
7

Blink's Service Worker team is keen on deprecating AppCache (We will follow our usual intent to deprecate process). We believe that Service Worker is a much better solution. Also, it should be pretty easy to offer a drop-in replacement for AppCache built on top of SW. We'll start by collecting usage metrics and do some outreach.

AppCache and Service Worker should coexist without any issue since offering offline support via AppCache for browsers that don't support Service Workers is a valid use case. @flo850 If it's not working, please let us know by filing a bug.

Loudmouth answered 2/3, 2015 at 9:36 Comment(7)
Thanks for answering, Kenji! Would Blink's Service Worker team wait until Service Worker is supported in most browsers before doing that, or will it proceed regardless?Sathrum
The plan is to look at our usage metrics. We will only count page loads where appcache was actually used (note: Service Worker if present would take precedence over AppCache).Loudmouth
Updating with AppCache is simple as changing a file. Service worker, in the other hand requires us to handle caches, cross-browser differences use polyfills, etc. Newer Chrome (at the moment) features require service workers. Does someone know if someone already did this "drop-in replacement"?Betrothal
Sorry for the duplicated comment, but, in addition, because the behavior cited by Kenji Baheux in the comment above I can't simple use the two features together, i.e.: the simple appcache updating process along the new service worker features. One simply cancels the other.Betrothal
@GustavoRodrigues that's incorrect. They coexist very well. You just need to use feature detection to load one set of offline logic, not both.Brillatsavarin
@Brillatsavarin I wrote that in 2015, probably my comment is outdated. From what I remember now enabling service workers automatically disables AppCache in Chrome, but seems it's now easier to make those two coexist (unlike it was in 2015).Betrothal
@GustavoRodrigues I didn't mean to load BOTH appcache and SW. It's either/or. So you code one set of logic for SW and load that if supported, and if not, load the appcache logic. Loading both will likely not work (and as you say, might be prevented by the browser) or will prove buggy.Brillatsavarin
P
4

I must say that Services Worker is not only the replacement for AppCache, but it’s far more capable. An AppCache can’t be partially updated, a byte-by-byte manifest comparison to trigger the update seems odd and there are several use cases leading to security and terrible usability problems.

Even Chrome and Firefox are planning to stop support for AppCache in the near future. Now that service workers are supported by Chrome, Opera, and Firefox.Also, The noises coming from Microsoft and Safari have been positive with respect to implementation and under consideration.

Primatology answered 18/5, 2016 at 14:24 Comment(0)
H
0

As a cache tool, it will coexist with appcache. Appcache works on virtually every browser.

But service workers are a solid foundation that will permit new usage like push (even when the browser is in the background) , geofencing or background synchronization.

Hangup answered 6/2, 2015 at 16:2 Comment(2)
Thank you for the answer. Do you have a source for it coexisting rather than being replaced?Sathrum
not really, but service worker are supported only ont the latest build of chrome, and firefox. It's not enough to be used widely. On the other hand , it can be quite tricky to make appcache AND service worker working togetherHangup

© 2022 - 2024 — McMap. All rights reserved.