Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve service worker script caching and update #1283

Merged
merged 4 commits into from
Mar 13, 2018
Merged

Commits on Mar 5, 2018

  1. Improve service worker script caching and update

    This change includes/considers the following:
     - Include imported scripts to byte-check (for classic scripts).
     - Compare responses' body instead of source text as per whatwg/html#3316.
     - Handle duplicate importScripts() as per #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 #1023 (comment).
    
    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.
    jungkees committed Mar 5, 2018
    Configuration menu
    Copy the full SHA
    fcabe9c View commit details
    Browse the repository at this point in the history

Commits on Mar 7, 2018

  1. Configuration menu
    Copy the full SHA
    ea84047 View commit details
    Browse the repository at this point in the history

Commits on Mar 8, 2018

  1. Do all byte-check before starting the service worker

    This addresses #1283 (comment).
    
    This makes fetching the imported classic scripts done before evaluating
    the main script such that it does not start the service worker if no
    scripts (including imported scripts) were updated.
    
    This replaces unnecessary flags with local variables according to
    comments.
    jungkees committed Mar 8, 2018
    Configuration menu
    Copy the full SHA
    e2c9db2 View commit details
    Browse the repository at this point in the history

Commits on Mar 13, 2018

  1. Configuration menu
    Copy the full SHA
    c34985f View commit details
    Browse the repository at this point in the history