Angular Service Workers & Cows — a love story
summary
Claims that Angular service workers make apps usable on 6 megabit rural connections by intercepting and caching network responses. Steps: install @angular/service-worker, run ng update to fix deps, enable and register the worker, run ng build --prod and serve the dist folder with an HTTP server using --proxy to forward API calls. Add a dataGroup in ngsw-config.json (strategy: performance, maxSize:100, maxAge:3d) to cache /api routes. Result: offline mode works and assets plus API responses load from cache.
AI-written summary · about
chapters (18)
- 0:00Intro
- 2:52WHAT BE YOU, SERVICE WORKER?
- 3:12WHAT DOES THE SERVICE WORKER DO?
- 6:02Install that Service Worker, yo
- 8:36Enable service worker
- 8:49Import SW in root app module
- 9:05Register SW in root app module
- 9:49I ASKED STEPHEN FLUIN, WHY IT WOULD BE BAD TO RUN SERVICE WORKERS OUTSIDE OF PRODUCTION MODE?
- 10:11Create the CONFIG file, ngsw-config.json
- 11:34#6 Build the project
- 12:56Run the project in production mode
- 14:07The caching our default config is giving us!!
- 14:38How do updates to me code work tho?
- 15:22Rebuild & restart the server
- 16:32Using a proxied server
- 17:15and of course, the offline test
- 17:36CACHING CUSTOM BITS
- 20:02It's for the cow-puppies 3
related talks
34mService Workers & Cows — a love story
30mService Workers & Cows — a love story
34mService Workers & Cows — a love story
36mAngular and Service Workers
33mAngular and Service Workers
29mService Workers: understand and use
22mAutomatic Progressive Web Apps using Angular Service Worker
38mSending your Angular App into deep, deep offline with Workbox
