Skip to content
All writing ‹ Part 11 of 18 · A Cache Is a Chain, Not a Box
Engineering · 4 min read

Two Cache Layers: What I Believed

The two-layer cache picture I drew from config files, and where it was wrong. A bypass header made the LB cache step aside on one route, but not the other.

A request passes two cache layers. I thought one bypass header always made the LB cache step aside.

This is the picture I drew after I read the config files. I kept it on purpose, because it is wrong.

what I believed Browser Akamai edge (30-day TTL) adds: X-Cache-Bypass: yes LB cache (3-day TTL) sees the header → does not use its own copy storage bucket
What I believed: one bypass header makes the LB cache step aside, so an Akamai miss always reaches the bucket.

What I Understood Then

  • Akamai adds X-Cache-Bypass: yes to every request sent to the origin.
  • The LB cache sees this header and skips its own cache.
  • So when Akamai has a miss, it always gets the latest file from the bucket.

Where I Was Wrong

What I thought (same on every route) In reality bucket route proxy route Akamai + X-Cache-Bypass LB cache storage steps aside ✓ steps aside ✓ does not readheader ✗ latest file latest file returns old copy
The bypass header works only on the bucket route, because the LB cache on the proxy route does not read it and returns the old copy.
What I thoughtIn reality
The LB cache steps aside when it sees X-Cache-BypassOnly the LB cache on the bucket backend has a rule that reads it. The one on the proxy backend does not (A Bypass Header Works Only Where a Rule Reads It)
An Akamai miss always gets the latest fileThe proxy route gets the old copy from the LB cache (Stale-While-Revalidate: Serve Old First, Refresh in the Background)
Akamai decides the TTLThe LB cache first pushes the TTL down to 3600 seconds or less (TTL Is Set in Three Places)
One purge of Akamai is enoughA purge cannot reach the LB cache, and Akamai gets the old file back from it (Akamai Tools: Purge and CLI)

This picture came from reading config files. It was not a test result. It holds only for the bucket route.

Reading config files gives you “should”. Sending one request gives you “actual”.

Related: Akamai Property: One Edge Config, Akamai Tools: Purge and CLI, How the Load Balancer Picks a Backend, TTL Is Set in Three Places, A Bypass Header Works Only Where a Rule Reads It. Or go back to the series overview.

↑↓ navigate ↵ open esc close