I am trying to complement existing offline appCache-based setup with a service worker for Chrome/Chromium(other browsers, namely Safari are still expected to use appCache).
Simplified [pseudo]code looks as follows:
<html manifest="offline.manifest">
...
<script type="text/javascript">
if (!window.applicationCache && navigator.serviceWorker && (/chrome/gi).test(navigator.appVersion)) {
navigator.serviceWorker.register('/service-worker.js');
}
</script>
...
</html>
My questions are:
- is there a way to figure out whether Chrome 82 will tolerate
<html manifest=offline.manifest>attribute? (by the time of writing this question, people installing Chrome 82 Canary report appCache is still available) - did anyone have a chance to use sw-appcache-behavior scripts in production?
Thanks.
UPD 08/05/20: AppCache removal has been moved to M85
A few hints are available in the HTML spec update.
It looks like manifest attribute will still be honored but no actual caching is going to happen.
There seem to be a way for testing disabled appCache using [reverse] Origin Trial. Details are available in blink-api-owners Google Group.
Despite sw-appcache-behavior being suggested by Chromium maintainers, its readme section indicates that it is not intended to be used in Prod yet.