Leveraging Stream API within Service Worker
summary
Demo shows streaming a grayscale PNG transformer and chunked JSON parser that process a 10 MB JSON over fetch using Response.body as a readable stream and piping through a TransformStream to avoid blocking the UI thread. Service Worker constructs a streamed Response, precaches header/footer with Workbox Streams and sends cached shell immediately while dynamic content arrives from network, cutting first-contentful-paint and parsing progressively rather than waiting for full download.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 1:13Stream API
- 1:41About Stream API
- 2:32Core Concepts
- 4:02Fetch
- 6:42Parse JSON
- 7:47Create Stream
- 8:32Create Option
- 10:08Precache
- 10:28Continuous strategy
- 11:36Summary
- 12:34Outro
related talks
50mNow THAT'S What I Call Service Worker!
38mImproving Media Content Performance with Service Workers
30mOther browser APIs that are going to change video on the web
32mThe ServiceWorker is coming, look busy
25mDemystifying Web Workers and Service Workers
21mOn the fly WebP decoding with Web Assembly and Service Workers (Main Stage)
29mFull Stream Ahead!
39mProgressive what apps
