Cache the page-owned app response before starting the worker
This commit is contained in:
@@ -27,3 +27,8 @@ export function assertWarmAssets(requests) {
|
||||
const assets=requests.filter(r=>r.bytes>0&&/\.(?:js|css|woff2?|png|svg)(?:[?#]|$)/.test(r.url)&&!new URL(r.url,'http://localhost').pathname.endsWith('/sw.js'));
|
||||
assert.deepEqual(assets,[],'warm reload does not transfer unfinished shell assets');
|
||||
}
|
||||
|
||||
export function assertColdAssets(requests) {
|
||||
const transferred=requests.filter(r=>r.bytes>0&&new URL(r.url,'http://localhost').pathname==='/app.js');
|
||||
assert.equal(transferred.length,1,'cold app.js transfers its body exactly once across page and worker');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user