Cache Fill
The process of populating a cache tier with content from upstream (shield or origin). A "fill" is essentially a cache miss that results in the content being stored. CDNs often track fill rates separately from hit rates to measure origin protection effectiveness.
Full Explanation
A cache fill happens when an edge server (or shield) does not have the requested content and has to fetch it from upstream. The edge sends a request to the next tier (shield or origin), gets the response, stores it in its local cache, and then serves it to the user. Every cache miss triggers a fill. The fill itself is what populates the cache so the next request can be a hit.
CDNs track fill rate as a key metric. Fill rate is the percentage of total requests that result in an upstream fetch. If your fill rate is 5%, that means 95% of requests are served from cache (your hit ratio is 95%). A low fill rate means great origin offload. A high fill rate means something is wrong: TTLs might be too short, cache keys too specific, Vary headers splitting your cache into too many variants, or query strings busting the cache unnecessarily.
Fill bandwidth is tracked separately because it directly maps to your origin egress costs. If your CDN serves 10 TB/day but only 500 GB of that comes from origin fills, you are paying for 500 GB of origin bandwidth instead of 10 TB. That difference is the value of caching.
Request flow during a cache fill:
User -> Edge (MISS) -> Shield (MISS) -> Origin
|
Response 200
|
Origin ----fill----> Shield ----fill----> Edge -> User
(cached) (cached) (cached)
Next request for same content:
User -> Edge (HIT) -> User # No fill needed
To reduce fills: increase your TTLs where possible, add an origin shield to consolidate edge misses, use request coalescing to prevent multiple simultaneous fills for the same URL, and consider cache warming for content you know will be popular. Monitor fill rate in your CDN dashboard. If it spikes after a deploy, check whether you accidentally changed cache keys or added new Vary headers.
Interactive Animation
Examples
Nginx configuration that shows fill-related headers for debugging:
# Add upstream status header to reveal fills
add_header X-Cache-Status $upstream_cache_status;
# Values: HIT, MISS, EXPIRED, STALE, BYPASS, REVALIDATED
# MISS and EXPIRED both trigger a cache fill
# Check fill status on a request
curl -sI https://cdn.example.com/video.mp4 | grep -i x-cache
# X-Cache-Status: MISS (this request triggered a fill)
curl -sI https://cdn.example.com/video.mp4 | grep -i x-cache
# X-Cache-Status: HIT (served from cache, no fill)
Frequently Asked Questions
The process of populating a cache tier with content from upstream (shield or origin). A "fill" is essentially a cache miss that results in the content being stored. CDNs often track fill rates separately from hit rates to measure origin protection effectiveness.
Nginx configuration that shows fill-related headers for debugging:
# Add upstream status header to reveal fills
add_header X-Cache-Status $upstream_cache_status;
# Values: HIT, MISS, EXPIRED, STALE, BYPASS, REVALIDATED
# MISS and EXPIRED both trigger a cache fill
# Check fill status on a request
curl -sI https://cdn.example.com/video.mp4 | grep -i x-cache
# X-Cache-Status: MISS (this request triggered a fill)
curl -sI https://cdn.example.com/video.mp4 | grep -i x-cache
# X-Cache-Status: HIT (served from cache, no fill)