Cloud Cost Sense

GCP Cloud CDN Cost: Cache Egress, Fill, and Requests

Estimate Google Cloud CDN cost from cache data transfer, cache fill, lookup requests, load balancing, origin traffic, and cache hit ratio.

Break the Cloud CDN bill into traffic paths

For a cache hit, model cache data transfer to the user and the cache lookup request. For a cache miss, add cache fill from the origin plus any applicable Cloud Load Balancing processing or Cloud Storage operation charges. Non-cacheable responses can instead use the origin service's standard data transfer path, so do not apply one CDN rate to every byte.

Record destination geography because cache data transfer prices vary by destination and monthly volume. Record the origin and edge locations as well because cache fill can be priced differently within a region group and between regions. Use GiB rather than decimal GB when matching usage to the official pricing table.

Estimate hits, misses, and request volume

Start with monthly GET and HEAD requests, average response size, and a measured or conservative cache hit ratio. Split delivered GiB into hits and misses, then calculate cache lookup requests, cache data transfer, and cache fill separately. Include response headers as well as bodies when reconciling the estimate with billed bytes.

Cache keys can fragment the cache when query strings, hosts, protocols, headers, or cookies create distinct objects. Short TTLs, frequent invalidations, personalized responses, and traffic spread across many cold objects can also reduce the hit ratio. Model a normal case and a low-hit case instead of assuming popular static-content behavior for the whole site.

Improve efficiency without caching private content

Set cacheable response headers and TTLs deliberately, compress appropriate assets, and remove cache-key dimensions only when responses truly do not vary by them. Never trade privacy for a higher hit ratio: forcing private or user-specific responses into a shared cache can expose content to the wrong user.

Track cache hit ratio, served bytes, origin bytes, request count, response size, and invalidations after launch. Enter application requests and download volume in the calculator, then add the CDN, load-balancer, and origin-specific charges from current official pricing. Recalculate when geography, asset mix, cache policy, or traffic volume changes.