CDN Caching Strategies: Pull, Push, and Hybrid

· Mei-Lin Wu · 4 min read

Two Philosophies of Cache Population

Every CDN must decide: do you cache content reactively when someone requests it (pull), or proactively before anyone asks (push)? The answer affects cold-start latency, origin load, storage efficiency, and operational complexity.

Performance Comparison: Edge vs Origin Processing
Metric Edge Processing Origin Processing Improvement
Latency (p50)8–15 ms120–300 ms15–20x faster
Cache Hit Ratio85–95%N/AReduces origin load
TLS Handshake1–5 ms (nearby PoP)50–150 ms10–30x faster
Bandwidth Cost$0.01–0.04/GB$0.05–0.12/GB3–5x cheaper
Availability99.99% (multi-PoP)99.9% (single DC)10x fewer outages

Pull Caching (Origin Pull)

In pull caching, the CDN fetches content from the origin server on demand — when the first user requests it.

How It Works

  1. User requests /image.jpg from the CDN edge
  2. Edge cache has no copy → cache miss
  3. Edge fetches from origin (possibly through a shield layer)
  4. Origin responds, edge caches the response and serves the user
  5. Subsequent requests for the same content are served from cache

Advantages

Disadvantages

Push Caching

In push caching, content is uploaded directly to the CDN's edge storage before users request it.

Cache Decision Flow — How the CDN determines cache hit vs missCache Decision Flow — How the CDN determines cache hit vs miss CDN Request Flow — From Browser to Edge CDN Request Lifecycle Step 1 DNS Lookup Step 2 TCP Connect Step 3 TLS Handshake Step 4 Edge Server Step 5 Cache Check Step 6 Response Cache HIT → 5ms response Cache MISS → Fetch origin 0ms ~50ms (cache hit) ~200ms (cache miss)
Figure 2: Cache Decision Flow — How the CDN determines cache hit vs miss

How It Works

  1. Content creator uploads files to CDN's storage API
  2. CDN distributes files to edge PoPs according to a distribution policy
  3. When users request content, it's already cached — every request is a hit

Advantages

Disadvantages

Hybrid Strategies

Most production CDN deployments use a hybrid approach:

Content TypeStrategyReasoning
Static assets (JS, CSS, images)Pull + long TTL + cache warmingAssets are pulled on first request, cached for months. Warming pre-populates before launches.
Video/mediaPush to regional PoPsLarge files benefit from pre-positioning. Users expect instant playback.
Dynamic contentPull + short TTLContent changes frequently, pull ensures freshness. See dynamic content caching.
Software updatesPush + global distributionLarge files, predictable release schedule, all users need it.

Pull CDN Implementation

To use a pull CDN, you configure the CDN with your origin server address. The CDN transparently fetches and caches content:

# CDN Configuration
Origin: https://origin.example.com
Cache Rules:
  *.js, *.css → Cache 1 year (content-hashed filenames)
  *.html → Cache 5 minutes, stale-while-revalidate 1 hour
  /api/* → Cache 60 seconds

Push CDN Implementation

Push CDNs provide storage APIs (typically S3-compatible) or CLI tools for uploading content:

# Upload to CDN storage
aws s3 sync ./dist s3://cdn-bucket/ --cache-control "max-age=31536000"

# Or via CDN's API
curl -X PUT https://storage.cdn.example.com/image.jpg   -H "Authorization: Bearer $TOKEN"   --data-binary @image.jpg

Choosing Your Strategy

Pull for most web content. Push for large media files and software distribution. Cache warming (hybrid) for time-sensitive launches where cold-cache penalties are unacceptable. Your CDN's cache hit ratio tells you if your strategy is working.

External References

References & Standards: HTTP/2 specification · W3C Web Performance