Skip to content
JAEWON CHANGSystems Dossier
Language

Specification

Organisation
Nudge Healthcare
Period
2024
Target
Static asset delivery path of the web service
Comparison
Measured before and after at comparable traffic levels
Role
Request-path analysis, cache policy design, implementation, verification

Context

Network usage and CDN cost were high. The billing line alone could not tell me whether traffic had grown or whether the same bytes were being sent repeatedly.

Rather than adding a new solution, I inspected the request path and cache behaviour first. Identical static assets were being re-requested, and the cache keys did not match how often those resources actually changed.

Approach

  1. I analysed the CloudFront cache structure, separating requests that hit at the edge from requests that reached the origin.

  2. Cache keys and invalidation were re-cut along how each resource actually changes: assets that almost never change were given a different policy from assets that change on every deploy.

  3. A Service Worker plus the Web Cache API took over browser-side caching, so repeat requests stopped crossing the network at all.

  4. After deploying, I measured the same metrics again and compared daily transfer and egress cost at comparable traffic levels.

System

Where a request stopsrequeston misson misson hiton hitBrowserService WorkerWeb Cache APICloudFrontre-cut cache keysOriginno networkno origin
Fig. cache cascade

Nothing was added to the path — requests were made to stop earlier on it.

A browser request meets the Service Worker cache first; on a hit it never reaches the network. Only a miss goes to CloudFront, and only an edge miss reaches the origin.

Measured

Daily network transfer

Before: 417 GB/dayAfter: 235 GB/day−43.6%

182 GB less per day, compared at comparable traffic levels.

Egress cost

−30%+

The reduction in transfer showed up directly on the bill.

Move it yourself

Raise the hit rate and requests stop earlier. Only the ones that reach the origin are billed as transfer.

BrowserService WorkerCloudFrontOrigin
Cache hit rate44%
Before (measured)After (measured)
Daily transfer

235GB/day

Reaching origin

56%

417 GB/day and 235 GB/day are the measured values. Everything between them is a linear model for illustration, not a bill.

Boundaries

  • These figures describe the static asset delivery path. They are a different measurement from the image delivery scale in project 04, which ran in the same account, and the two are never summed.
  • Application logic on the origin was not part of this change.