yceffort
04 POSTS

Service-worker 1

  • #pwa#caching#service-worker

    Saving Marp Slides from a Next.js App for Offline Use

    I built offline saving into a Marp slide viewer. This post follows the process from the first attempt to run the existing viewer offline as-is to fixing, one at a time, the problems that deploys, networks, and the presenter window exposed.

    Updated 23 min read
  • ◆ Service Worker Caching Deep Dive Part 3
    #service-worker#web-performance#caching

    Measuring the Cost of Going Through a Service Worker: Building in the Lab the Control Group GA4 Could Not Give Me

    I set out to confirm the 500 ms that part 2 left as the cost of going through the worker, but the hard reloads that would form the control group arrive at under one a day. With a control group built from Playwright and a shaping proxy, going through the worker cost 2 ms on a navigation. Most of the extra time on a post click came from the worker saving the post HTML in the background over the same connection, and the gap between lab and field data was a measurement definition difference caused by 103 Early Hints.

    Updated 50 min read
  • ◆ Service Worker Caching Deep Dive Part 2
    #service-worker#caching#nextjs

    Applying Service Worker Caching: App Router Traps and GA4 Field Data

    I made this blog (Next.js App Router) open offline. On the first deploy, the post I had just read would not open offline; on the second, posts opened but every image was broken. After fixing the problems from soft navigation, prefetching, and next/image one at a time, GA4 real-user data showed returning-visitor FCP 634ms faster on average and TTFB 525ms slower on average.

    Updated 27 min read
  • ◆ Service Worker Caching Deep Dive Part 1
    #service-worker#caching#browser

    How Service Worker Caching Works: The Proxy, the Lifecycle, and Five Strategies

    This post covers the service worker material that did not fit into the cache chapter of Frontend Performance Optimization Deep Dive (published in Korean). It works through why caches go stale, why the old version shows up after a deploy, what to store under which strategy, and whether you should use one at all, and measures a 104KB opaque response being counted as 6.6MB of storage.

    Updated 24 min read