Cache Efficiency
How v.recipes uses a three-layer caching strategy — local data center, global across data centers, and upstream — to answer DNS queries with minimal latency.
Cache Lookup Scenarios
L1 Cache Hit
FastestThe data center handling the request has a fresh cache entry for this domain. The response is returned immediately.
L2 Cache Hit
FastThe local data center did not have the answer, but another Cloudflare data center globally did. The response is fetched from there.
Full Cache Miss
UpstreamNeither L1 nor L2 has the answer. The query is forwarded to the upstream resolver, and the result is seeded into both cache layers.
Typical Cache Performance
Because most DNS queries are for popular domains (search engines, CDNs, social media), the vast majority of requests are served from the L1 or L2 cache without touching the upstream resolver. Even when a user's request lands in a data center with a cold L1, it is often served by another data center via L2. This keeps latency low across the globe and reduces unnecessary load on upstream providers.
Key Concepts
L1 Cache (Data Center)
Cache local to each data center, scoped to the Cloudflare data center that received the request. When a query arrives, its response is cached locally so subsequent requests from the same PoP are served immediately from the local cache — the fastest path.
L2 Cache (Global)
If the receiving data center does not have a cached entry, the query checks whether any other Cloudflare data center worldwide has it cached. This vastly reduces the number of queries that need to reach the upstream resolver.
L3 Cache (Upstream)
When both L1 and L2 miss, the query is forwarded to the configured upstream provider (e.g., Cloudflare 1.1.1.1 or Google DNS), which may itself have the result cached. This is the slowest path but ensures every query eventually receives an answer. On return, the response is seeded into L2 and L1.
Cache Cascade
When L2 serves a hit, the result is written back to L1 so the receiving data center has it locally for the next request. When L3 responds, the result populates both L2 and L1. This cascading fill keeps the hottest data at the closest layer over time.