Cloud CDN
Cloud CDN (Content Delivery Network) uses Google's globally distributed edge points of presence to cache HTTP(S) load-balanced content close to your users. It is enabled with a single checkbox on the backend service of an external Application Load Balancer, giving faster delivery while reducing serving costs.
- 90+ cache sites (edge points of presence) spread across metropolitan areas.
- Regions covered: Asia Pacific, Americas, and EMEA.
- The authoritative, up-to-date list lives in the Cloud CDN documentation.
Response flow
A URL map on the load balancer decides which backend serves the content - for example, a Cloud Storage bucket for static content and instance groups for PHP traffic.
- Cache miss: the first user in San Francisco requests content the local cache site cannot fulfill. The cache may pull it from a nearby cache (say, one that already served a Los Angeles user); otherwise the request is forwarded to the Application Load Balancer, which routes it to a backend (the
us-central1instance group or theus-east1bucket). - Cache hit: if the backend response is cacheable, the San Francisco cache site stores it. A later request for the same content is served from the edge, shortening the round-trip time and sparing the origin from processing the request.
Before forwarding to the load balancer, a cache site may fetch the content from a nearby cache site that already has it. The origin backend is only contacted when no edge cache can serve the request.
Every Cloud CDN request is automatically logged in Google Cloud; each log entry records a Cache Hit or Cache Miss status for the load balancer's HTTP request.
Cache modes
Cache modes control the factors that determine whether Cloud CDN caches your content - whether it respects the origin's cache directives, and how cache TTLs are applied. Cloud CDN offers three:
Because FORCE_CACHE_ALL ignores origin directives, do not use it on a shared backend that serves private, per-user content (dynamic HTML, API responses) - it would cache and re-serve one user's private response to others.