~/talk

Angular Service Workers & Cows — a love story

Talkat NGConf 2018 · on Friday, 2018-04-20· [pwa, angular]
slides:none on file

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

  1. 0:00Intro
  2. 2:52WHAT BE YOU, SERVICE WORKER?
  3. 3:12WHAT DOES THE SERVICE WORKER DO?
  4. 6:02Install that Service Worker, yo
  5. 8:36Enable service worker
  6. 8:49Import SW in root app module
  7. 9:05Register SW in root app module
  8. 9:49I ASKED STEPHEN FLUIN, WHY IT WOULD BE BAD TO RUN SERVICE WORKERS OUTSIDE OF PRODUCTION MODE?
  9. 10:11Create the CONFIG file, ngsw-config.json
  10. 11:34#6 Build the project
  11. 12:56Run the project in production mode
  12. 14:07The caching our default config is giving us!!
  13. 14:38How do updates to me code work tho?
  14. 15:22Rebuild & restart the server
  15. 16:32Using a proxied server
  16. 17:15and of course, the offline test
  17. 17:36CACHING CUSTOM BITS
  18. 20:02It's for the cow-puppies 3
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.