You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to dev-pl...@lists.mozilla.org
*Summary: *While ServiceWorkers are intended to improve the performance of
websites, it's possible for them to be counterproductive to performance.
When navigating to a website with a registered ServiceWorker handling fetch
events, the browser must first start up the ServiceWorker before the
ServiceWorker has an opportunity to provide a response. If the
ServiceWorker doesn't provide a response or simply performs a fetch to the
initial target URL, the network response time is unnecessarily delayed by
the ServiceWorker's start up time.
The idea of "navigation preload" addresses this issue; this API enables the
browser to perform a "preload request" for navigations that are potentially
handled by a ServiceWorker before executing the ServiceWorker's fetch
handler. An associated "preload response" will be available to the
ServiceWorker in its fetch handler via a Promise; the ServiceWorker may use
the preload response if it doesn't have a response of its own to provide.
By making ServiceWorker start up and the preload request concurrent, this
API effectively reduces the worst-case network response time as described
above from O(ServiceWorker start up time + network request time) to
O(max(ServiceWorker start up time, network request time)).
Additionally, to allow servers to distinguish between preload requests and
non-preload requests, a "Service-Worker-Navigation-Preload" HTTP header
will be included with each preload request. Users of the API will have
control over this header's value.
*Preference:* Enabling this feature will require two preferences:
dom.serviceWorkers.navigationPreload.enabled=true (false by default)
dom.serviceWorkers.parent_intercept=true (true by default on Nightly;
targeting true by default on Beta/Release for Firefox 73)
*Is this feature enabled by default in sandboxed iframes?* Yes, and it does
preserve the invariants in terms of what sandboxed iframes can/can't do.
--
Perry Jiang <pe...@mozilla.com>