[w3c/ServiceWorker] Improve service worker script caching and update (#1283)

This change includes/considers the following:
 - Include imported scripts to byte-check (for classic scripts).
 - Compare responses' body instead of source text as per https://github.com/whatwg/html/issues/3316.
 - Handle duplicate importScripts() as per https://github.com/w3c/ServiceWorker/issues/1041.
 - Replace *imported scripts updated flag* referenced in importScripts()
   by using service worker's state item.
 - Have Update's perform the fetch steps cover module scripts.
 - Avoid dobule-download of imported scripts pointed out in https://github.com/w3c/ServiceWorker/pull/1023#discussion_r92201798.

This change basically makes it check out if the main script resource is
identical to the existing resource. If so, it returns; otherwise, it
creates a new service worker and evalute it to check out if any imported
scripts are changed. It continues with Install only when any of the
resources has been changed. With the change, importScripts() returns
resources from the cache for any duplicated requests including the
request for the main script.

Fixes #1041, #1212, #1023.
You can view, comment on, or merge this pull request online at:

  https://github.com/w3c/ServiceWorker/pull/1283

-- Commit Summary --

  * Improve service worker script caching and update

-- File Changes --

    M docs/index.bs (81)

-- Patch Links --

https://github.com/w3c/ServiceWorker/pull/1283.patch
https://github.com/w3c/ServiceWorker/pull/1283.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/pull/1283

Received on Monday, 5 March 2018 13:01:37 UTC