Warm Cache
A cache populated with frequently-requested content, delivering a high hit ratio. Most requests are served directly from cache without touching the origin. The goal state for any CDN deployment.
Full Explanation
A warm cache is a healthy cache. The most popular content is stored and served directly to users, origin load is minimal, and response times are fast. Cache hit ratios above 90% are common for well-configured CDN setups with static assets.
Getting to a warm cache requires good cache key design, appropriate TTLs, and enough traffic to populate the cache naturally. Long-tail content (rarely requested URLs) may never warm up at the edge, which is where origin shields help—even if individual edge PoPs are cold for niche content, the shield stays warm.
Keeping a cache warm means avoiding unnecessary purges, using stale-while-revalidate to prevent gaps during revalidation, and monitoring hit ratios per PoP. A sudden drop in hit ratio is an early warning sign of misconfiguration, a deploy gone wrong, or a traffic pattern shift.
Try the interactive Cache Hit vs Miss animation in the course to compare response times between warm cache hits and cold cache misses.
Examples
Checking cache status in response headers:
# Warm cache hit
curl -sI https://cdn.example.com/logo.png | grep -i x-cache
# X-Cache: HIT
# Age: 3542
# X-Cache-Hits: 847
# Cache miss (first request or expired)
curl -sI https://cdn.example.com/rare-page.html | grep -i x-cache
# X-Cache: MISS
# Age: 0
Monitoring cache hit ratio in Varnish:
# Real-time hit rate
varnishstat -f MAIN.cache_hit -f MAIN.cache_miss
# Calculate hit ratio
varnishstat -1 -j | python3 -c "
import json, sys
d = json.load(sys.stdin)['counters']
hits = d['MAIN.cache_hit']['value']
miss = d['MAIN.cache_miss']['value']
print(f'Hit ratio: {hits/(hits+miss)*100:.1f}%')
"
Frequently Asked Questions
A cache populated with frequently-requested content, delivering a high hit ratio. Most requests are served directly from cache without touching the origin. The goal state for any CDN deployment.
Checking cache status in response headers:
# Warm cache hit
curl -sI https://cdn.example.com/logo.png | grep -i x-cache
# X-Cache: HIT
# Age: 3542
# X-Cache-Hits: 847
# Cache miss (first request or expired)
curl -sI https://cdn.example.com/rare-page.html | grep -i x-cache
# X-Cache: MISS
# Age: 0
Monitoring cache hit ratio in Varnish:
# Real-time hit rate
varnishstat -f MAIN.cache_hit -f MAIN.cache_miss
# Calculate hit ratio
varnishstat -1 -j | python3 -c "
import json, sys
d = json.load(sys.stdin)['counters']
hits = d['MAIN.cache_hit']['value']
miss = d['MAIN.cache_miss']['value']
print(f'Hit ratio: {hits/(hits+miss)*100:.1f}%')
"
Related CDN concepts include:
- Cache Fill — The process of populating a cache tier with content from upstream (shield or origin). A …