PROVIDER - AWS CDN

AWS CloudFront

Amazon CloudFront is officially a low-latency content delivery network (CDN) that helps you distribute static and dynamic content quickly and reliably across AWS's global edge.

CDN Acceleration United States 2026.11.19
4.6pts

Service Overview

Verified 2026-11-19: https://aws.amazon.com/cloudfront returns 200 and settles on https://aws.amazon.com/cloudfront/ with the title "Low-Latency Content Delivery Network (CDN) - Amazon CloudFront - Amazon Web Services" and a meta description about distributing static and dynamic content quickly and reliably with performance, security and developer ease of use. This matches the existing positioning.

Verified 2026-11: the official title is Low-Latency Content Delivery Network (CDN) - Amazon CloudFront, describing fast and reliable distribution of static and dynamic content.

AWS CloudFront is the content delivery product line of Amazon Web Services, launched in 2008 and filed under CDN acceleration in 16IDC. As of 2026 it operates 600+ points of presence across 90+ cities in 135+ countries: 300+ of them are edge locations handling the last mile, while 13 are Regional Edge Caches sitting between the edge and the origin to aggregate traffic. Stacked together, the two tiers typically push static origin offload into the 30%-50% range.

The core brand AWS (launched by Amazon in 2006, headquartered in Seattle, USA) sells compute, storage and databases, and CloudFront is the side of that stack facing users. The right way to understand it is "the layer that sits in front of the origin on an AWS architecture diagram" rather than "yet another CDN vendor": a typical dynamic request path is Route 53 to CloudFront to ALB or API Gateway to EC2, while a static asset path is CloudFront to S3. To CloudFront, whatever sits behind it is the same kind of thing — it cares about the origin protocol, the origin domain and the certificate, not whether that machine is a virtual server, a load balancer or an object storage bucket.

That position defines both its capability and its cost. The capability is that an origin gains global termination, TLS offload, edge caching and request rewriting without a single line of code change. The cost is that almost every switch maps to a concept from another AWS service, with distributions, cache behaviors, cache policies, origin request policies, response headers policies and log destinations spread across different screens, which is why first-time users loop on "which policy governs which behavior". This is also the essential difference from Cloudflare: the latter gets most sites running on a set of defaults, while the former asks you to think the policies through first and then write them down.

One boundary deserves stating up front: CloudFront's advantage is having the fewest seams with other AWS parts. When the origin is on S3 you authorize it with OAC, when the origin is an ALB you allow CloudFront's origin-facing ranges, certificates renew automatically through ACM, and DNS resolves through Route 53 alias records — all native actions inside one account. Once the origin lives outside AWS, that integration advantage shrinks into "a general-purpose CDN with plenty of nodes but heavy configuration", and a comparison based on node count, regional unit price and operational effort may not favor it.

Key Strengths

  • 600+ points of presence and dual-tier caching lift origin offload to 30%-50%: 300+ edge locations serve the last mile while 13 Regional Edge Caches aggregate requests closer to the origin, so even rarely requested objects get a hit at the near-origin tier instead of travelling back to S3 or EC2 every time. Origin Shield goes one step further and merges requests from several distributions pointing at the same origin into a single path, which pays off most for cross-continent delivery; the origin path is broken down in CDN origin basics.
  • Cache policy is an explicit object, so hit rate can be engineered: a cache policy decides what enters the cache key, an origin request policy decides which headers and parameters reach the origin, and a response headers policy decides what extra headers are injected — three separate objects for three separate jobs, a design that is easier to reason about than scattered checkboxes. The price is that the differences must actually be understood: putting cookies or every query string into the cache key generates a private cache entry per visitor, and a header missing from the origin request policy means the origin sees a request that looks different from a direct hit. Naming and composition are covered in cache key strategy.
  • Lambda@Edge turns the edge from "cacheable" into "programmable": 4 event triggers (viewer request, origin request, origin response, viewer response) let you insert Node.js or Python logic at fixed points on the request path, with a 30-second execution ceiling and billing based on a 128MB memory x 50ms baseline, plus 2M requests per month free in the first year. The scenarios that pay off are the ones where a single response header solves the problem: CSP and HSTS hardening, A/B bucketing, URL normalization and token validation, without touching the origin release process for one header.
  • Security and compliance reuse the AWS stack as-is: SOC 1/2/3, PCI-DSS Level 1, HIPAA and ISO 27001/27017/27018/27701 all sit on the compliance list, AWS WAF bills at $5.00 per month per web ACL plus $0.60 per million rule matches, and Shield Advanced provides a 99.99% DDoS SLA with mitigation at the 10+ Tbps scale plus attack-traffic cost protection. For enterprises that must hand evidence to auditors, this combination saves the cost of hiring another security vendor and reconciling two logging conventions.
  • Route 53 and ACM together remove certificate-expiry incidents: Route 53 alias records point straight at the distribution and health checks participate in failover, while ACM-issued certificates renew automatically so nobody swaps a certificate by hand before an expiry date. A CDN certificate expiring is a simultaneous failure on every node, and handing that job to automatic renewal instead of a calendar reminder is one of the highest-value configurations in operations.
  • Billing lands in one bill, so cost is observable: CloudFront charges appear alongside other AWS resources, and Cost Explorer, Budgets and tagging can split "which distribution and which environment spent what". The first-year free tier covers 1TB of transfer per month plus 10M requests per month, which is enough to validate an architecture; judging the scale beyond it requires walking the tiers in the pricing table below.

Product Ecosystem

Distributions, Cache Behaviors and Policies

A distribution is the outer container, and one distribution can carry several cache behaviors split by path prefix — /api/* uncached and /static/* with a long TTL is the classic pairing. Each behavior binds three policies: the cache policy owns the cache key and TTLs, the origin request policy owns the headers, cookies and parameters forwarded to the origin, and the response headers policy owns extra output such as CORS and security headers. The value of this layering is using completely different cache rules for different paths on the same origin; the cost is that the three concepts must be kept apart, otherwise you end up in the trap of "the rule changed but the behavior did not", and the configuration order is in the CloudFront setup guide.

Lambda@Edge and Lightweight Rewrites

Lambda@Edge fits logic that needs a full runtime, network access or more memory. For lighter actions such as rewriting a header, rewriting a URI or issuing a simple redirect, CloudFront offers a lighter execution form, so there is no need to pay Lambda@Edge's billing and cold-start cost. The test is simple: does the logic need external dependencies? If it must make an authorization request at the edge, use Lambda@Edge; if it only rewrites /old to /new, use the lightweight form.

Security Side: WAF, Shield and OAC

AWS WAF filters requests before the distribution, managed rule groups cover common injection and scanning signatures, and rate rules handle abnormally frequent sources; Shield Advanced handles DDoS mitigation and cost protection. On the origin side sits OAC (Origin Access Control): the S3 bucket stays private and only IAM-signed CloudFront origin requests may read it, which is far harder to bypass than a Referer or IP allowlist. These three layers stack rather than replace each other — WAF covers application-layer signatures, Shield covers traffic surges, OAC covers who may reach the bucket directly.

Wiring to S3, EC2 and ALB

An S3 static site is the classic combination: S3 standard storage bills at $0.023/GB, CloudFront handles global delivery and TLS termination, and OAC lets the origin stay private. When EC2 or an ALB is the origin, the security group has to recognize CloudFront's origin-facing ranges, otherwise origin requests get blocked by your own security group — one of the most common reasons a configuration looks correct while the origin keeps timing out. The choice between the three comes down to: S3 is cheapest for static assets, ALB is most flexible for dynamic traffic, and pointing directly at EC2 is simplest for a single small site but lacks health checks.

Limitations

  • Cache keys are the easiest thing to misconfigure, and the effect is a silent drop to zero hit rate: if the default setup puts every query string and every cookie into the cache key, each visitor's request is treated as a distinct object, edge caching becomes decorative, and origin traffic grows linearly with visits, with the bill exposing the problem before the page does. The fix is to include only the dimensions that genuinely change the response and forward the rest through the origin request policy.
  • Invalidation is the second frequent misconfiguration: shipping a release by uploading a file with the same name and purging the cache works for a while, but eventually runs into propagation delay and quota limits; versioning the file name or path lets old entries expire naturally instead. On top of that, a minimum TTL set longer than the maximum TTL produces the confusing state where the origin already returns new content while the edge still serves the old copy, and the boundary between the two strategies is in cache purging and preheating guide.
  • Cost beyond the free tier is high and scattered: after the first year pricing is metered, at $0.085/GB in the United States and $0.140/GB in Asia Pacific; a 10TB/month site can exceed $1,000 per month, and Lambda@Edge ($0.60 per million requests), WAF ($5.00 per month plus $0.60 per million matches) and inter-region data transfer all add on top. Budgets should start from the origin-fetch ratio and the regional spread of egress, because those two decide the total far more than unit price does.
  • Configuration is spread out, and so are the logs: behaviors live on the distribution page, policies live in another list, real-time logs need their own delivery setup, standard logs land in S3 and metrics sit in CloudWatch. Diagnosing "some users in one region get stale content" usually means lining up timelines and status codes across three places, a real burden for teams without a dedicated SRE.
  • Mainland China is outside the coverage: the global network has no mainland China nodes, so domestic delivery requires AWS China operated by NWCD (Ningxia) and Sinnet (Beijing), with a separate account, separate ICP filing and a shorter service list than the global regions. Cross-border work usually splits the two sides: CloudFront globally and Alibaba Cloud CDN for China traffic, each optimized on its own.

Use Cases

  • Businesses whose origin already runs on AWS (★★★★★): with S3, ALB or EC2 as the origin, OAC authorization, security group allowances, ACM certificates and Route 53 aliases are all native actions, so the integration payoff is largest.
  • Large e-commerce and global SaaS (★★★★★): first contentful paint can drop from 5 seconds to under 1.5 seconds, Lambda@Edge handles edge personalization and A/B bucketing, and dynamic PUT/POST traffic uses the optimized path as well.
  • Video streaming and OTT (★★★★): HLS/DASH segments ride the edge cache, and 13 Regional Edge Caches aggregate popular segments, with AWS media services completing the pipeline.
  • Static sites and JAMstack (★★★★): S3 plus CloudFront plus OAC has a clear cost structure and keeps the origin private, which suits documentation sites, blogs and front-end build output.
  • Game downloads and patches (★★★★): installers in the 10GB-100GB range distributed through two cache tiers sharply reduce origin fetches.
  • Small sites hosted outside AWS (★★★): workable, but the integration advantage disappears and configuration cost outweighs the benefit, so these sites are better served by lighter options.

Pricing

Usage-based, with prices varying by egress region and volume tier; the figures below indicate scale on public terms:

Item Pricing
Free tier (first year) 1TB transfer/month + 10M requests/month + 2M Lambda@Edge requests/month
Data transfer (<10TB/month) $0.085/GB (US), $0.140/GB (Asia Pacific), $0.081/GB (Europe)
Data transfer (10-50TB/month) $0.080/GB (US), $0.130/GB (Asia Pacific), $0.076/GB (Europe)
Data transfer (>500TB/month) $0.050/GB (US), $0.080/GB (Asia Pacific), $0.050/GB (Europe)
HTTP/HTTPS requests $0.0075-$0.0165 per 10K requests
Lambda@Edge $0.60 per million requests + $0.00005001 per 128MB-second
AWS WAF $5.00 per month per web ACL + $0.60 per million rule matches
Shield Advanced From $3,000 per month, includes a 99.99% DDoS SLA
S3 standard storage (static origin) $0.023/GB/month

The unit prices explain what one gigabyte costs, not why a given month was expensive. Three variables decide the bill: cache hit rate, which sets the origin-fetch ratio and therefore the origin's egress cost; the regional spread of egress, since Asia Pacific is priced above the United States and Europe and traffic is billed where it leaves; and attached service calls, where edge functions and rule matches are billed per request and scale with volume. Build the budget by adding "daily egress x regional unit price + requests x request price + edge function invocations" rather than multiplying traffic by a single unit price.

The coupling between TTL and cost is another point that gets missed: setting image TTLs to 7 days and CSS and JS to 1 year clearly cuts origin fetches, while shortening TTLs just so changes appear immediately turns the CDN into a reverse proxy and raises both transfer cost and origin pressure. Cache parameters belong in the release process, not in a cleanup exercise after the bill arrives.

FAQ

  • How do I choose between CloudFront and Cloudflare? Base the decision on origin location and appetite for configuration, not node count. If the origin runs on AWS and must interlock with IAM, S3, Route 53 and WAF, choose CloudFront; if origins are scattered, you want something that works after connecting, and budget matters, choose Cloudflare. The positioning difference and the option of combining both are covered in CDN comparison.
  • How should cache keys be configured so the CDN is not wasted? Put only the dimensions that genuinely change the response into the key: the path is mandatory, business parameters go in as needed, and cookies and headers should mostly be forwarded through the origin request policy. The test is whether the same URL with the same key must return identical content, and the diagnostic order for a low hit rate is in cache key strategy.
  • Users still see old files after a release — what now? Check TTLs and the invalidation path first: an active purge suits urgent corrections but carries propagation delay, while versioned file names suit routine releases because old entries expire on their own. When mixing the two, make sure the minimum TTL is not longer than the maximum TTL; the trade-off is detailed in cache purging and preheating guide.
  • Can it accelerate users in mainland China? The global network does not cover mainland China. There are two approaches: use AWS China (Beijing, Ningxia), which needs a separate account and ICP filing and offers a shorter service list than the global regions; or split the work, sending domestic traffic to Alibaba Cloud CDN and keeping global traffic on CloudFront. The compliance boundary and implementation order of both are in hosting without ICP filing.
  • Should the S3 origin use OAC or some other allowlist? Use OAC. It relies on IAM signing, keeps the bucket private and lets only CloudFront origin requests read it, whereas Referer and IP allowlists can be forged or break as node ranges change. Certificate chain and origin protocol consistency matter just as much, and the details are in CDN HTTPS configuration basics.

Code Examples

Example 1: Create an invalidation and check its status

export DIST_ID="E2EXAMPLE12345"

# Create an invalidation; /* covers the whole distribution
aws cloudfront create-invalidation \
  --distribution-id "$DIST_ID" \
  --paths "/*" "/static/*"

# Check the latest invalidation status
aws cloudfront get-invalidation \
  --distribution-id "$DIST_ID" \
  --id "$(aws cloudfront list-invalidations \
      --distribution-id "$DIST_ID" \
      --query 'InvalidationList.Items[0].Id' \
      --output text)"

Paths accept wildcards; invalidating per directory keeps costs and origin load down.

Example 2: Standardize cache key and TTL with a cache policy

{
  "Name": "static-assets-7d",
  "Comment": "Static assets cached for seven days",
  "DefaultTTL": 604800,
  "MaxTTL": 31536000,
  "MinTTL": 0,
  "ParametersInCacheKeyAndForwardedToOrigin": {
    "EnableAcceptEncodingGzip": true,
    "EnableAcceptEncodingBrotli": true,
    "HeadersConfig": { "HeaderBehavior": "none" },
    "CookiesConfig": { "CookieBehavior": "none" },
    "QueryStringsConfig": { "QueryStringBehavior": "none" }
  }
}

Save the policy as policy.json, run aws cloudfront create-cache-policy --cache-policy-config file://policy.json, then attach it to a behavior.

Community & Resources

Communities and official channels

Learning resources and tools

Visit AWS CloudFront Website → https://aws.amazon.com/cloudfront
Visit Website ↗