When should a product use a CDN, and how is the cost calculated?
Evaluate a CDN when cross-region latency, static-asset delivery, traffic spikes, or origin exposure affects experience or availability. Do not wait for a fixed user count. The budget includes edge egress or bandwidth, requests, optional processing and security, origin traffic from cache misses, and configuration and operations—not only a price per gigabyte.
A CDN caches suitable content near users, shortening network paths, reducing origin transfer, and absorbing peaks. Incorrect cache keys, stale invalidation, or caching an authenticated response can instead expose data and complicate diagnosis. Content characteristics and measured service outcomes should decide.
When defining budget, scope, and cost assumptions, also compare How is the App Store commission calculated, and which costs does it affect? and How should an annual SMS verification budget be calculated?; the linked guidance adds context that should be considered in the same decision.
Strong signals include images, scripts, packages, or video dominating origin egress; materially different P95 transfer time across regions; event peaks beyond origin capacity; or a need for DDoS, WAF, TLS, or access controls before the origin. Large files, dispersed users, or a hidden origin can justify CDN at low user counts. A local intranet, concentrated audience, or wholly dynamic service may see little benefit.
| Delivery model | Suitable scope | Observe | Principal cost and risk |
|---|---|---|---|
| Origin only | Internal or concentrated early service | Origin egress, P95 latency, errors | Origin scale and one failure domain |
| Standard cache | Images, JS/CSS, downloads, public static content | Hit ratio, edge latency, origin traffic | Egress/bandwidth, requests, invalidation |
| Static/dynamic split | Cacheable page portions with dynamic APIs | Per-path hit ratio, TTFB, correctness | Cache key and authorization complexity |
| Image/video delivery | Resizing, on-demand video, transcoding | Processing, startup, buffering, viewing traffic | Processing, storage, delivery, options |
CloudFront's pricing varies data transfer and requests by region and feature. Alibaba Cloud's current CDN billing overview separates required basic service from optional value-added services such as HTTPS requests and log delivery, with traffic, peak-bandwidth, and package choices. Provider structures differ, so a fixed “domestic GB price with overseas doubled” is not durable.
Estimate edge delivery + requests + image/video/security/log options + origin and miss traffic + operating effort. Hit ratio matters: the same 10 TB delivered with 95% and 50% hits puts very different load on the origin. Request charges can dominate small objects; delivery and processing usually dominate video. Model regions, free tiers, commitments, and package overage separately.
Wavesteam tests representative paths—such as application scripts, product images, or downloads. We record regional P50/P95 latency, origin peak, and errors before enabling the CDN for only those paths, then measure hit ratio, origin bandwidth, invalidation time, 5xx, TLS, and cost per ten thousand successful visits. Signed URLs, private files, and sessions require explicit isolation tests.
Configuration belongs in versioned infrastructure or another auditable record with cache rules, invalidation, origin authentication, and cost alerts. Expansion follows evidence that latency and origin peaks improve at acceptable cost. If it does not, retain direct origin delivery or narrow the cached surface. Final pricing comes from the selected account's current official rate or quotation.