Currently, scripts in a Service Worker's cache is not compiled until it is run the first time. Even then, we only produce code cache for the top-level function (and IIFEs).
Maybe we should do more:
- Compile the whole script eagerly, including inner functions, and producing the code cache for that.
- Compile and produce code cache upon adding to the cache and not at the first run. Compiling and caching on first run would be on the critical path to loading.
Comment 1 by kinuko@chromium.org
, Sep 26 2017