Skip to content
Latchkey

What Is Amazon CloudFront? AWS Content Delivery Network

Amazon CloudFront is AWS content delivery network: it caches your content at edge locations around the world so users get fast responses from a nearby point of presence.

CloudFront sits between your users and your origin (often an S3 bucket or a load balancer), caching responses close to where requests come from. It cuts latency, absorbs traffic spikes, terminates HTTPS, and provides a security layer in front of your application.

How a CDN edge works

When a user requests a file, CloudFront serves it from the nearest edge cache if available. On a cache miss, it fetches from your origin, stores the response, and serves subsequent requests from the edge. This dramatically reduces origin load and round-trip time.

Origins and behaviors

A distribution points at one or more origins and uses cache behaviors to decide how different paths are cached. You control TTLs, which headers and query strings affect caching, and how requests route to each origin.

Security features

  • Free HTTPS certificates via ACM for your domains.
  • Origin access control so only CloudFront can read a private S3 bucket.
  • Integration with AWS WAF for filtering malicious traffic.
  • Geo-restriction to allow or block specific countries.

Cache invalidation

Because the edge caches aggressively, deploying new content means telling CloudFront to drop stale copies. You issue an invalidation for changed paths (or use versioned filenames to sidestep the problem entirely).

Role in CI/CD

A front-end deploy job uploads the build to S3, then creates a CloudFront invalidation so users see the new version immediately. Both steps run from the pipeline using an IAM/OIDC role. Versioned asset filenames let you invalidate only index.html and keep caching everything else.

Key takeaways

  • CloudFront caches content at global edge locations to reduce latency.
  • It fronts origins like S3 or load balancers and adds HTTPS and security controls.
  • Deploys must invalidate the cache so users see freshly published content.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →