SkillSprout
Chapter 2 · Lesson 3
Intermediate
7 min read

Edge Locations

Overview

Edge locations are AWS sites distributed in hundreds of cities worldwide that sit much closer to end users than a Region does. They are part of the AWS Points of Presence (PoPs) network and are used by services such as Amazon CloudFront (content delivery), Amazon Route 53 (DNS), AWS Global Accelerator, AWS WAF and AWS Shield.

You cannot launch EC2 instances or databases in an edge location. Instead, edge locations cache content, answer DNS queries, terminate TLS and forward traffic over the fast AWS private backbone to your origin in a Region. The result is lower latency, higher throughput and better protection from attacks.

For the SAA-C03 exam you need to know which service to choose for global performance problems, and how edge caching differs from running workloads in multiple Regions.

Key Concepts

  • Edge locations are Points of Presence — hundreds of them globally, far more than Regions.
  • CloudFront caches static and dynamic content at the edge and forwards misses to the origin (S3, ALB, EC2, custom HTTP).
  • Regional Edge Caches sit between edge locations and origins, with larger caches to reduce origin load.
  • Route 53 serves DNS from edge locations worldwide; Global Accelerator gives two static anycast IPs and uses the AWS backbone.
  • S3 Transfer Acceleration uses edge locations to speed up uploads to a bucket over long distances.
  • Lambda@Edge and CloudFront Functions run code at the edge for header manipulation, redirects and auth.
  • AWS WAF and Shield protect applications from Layer 7 and DDoS attacks at the edge.
  • Local Zones, Wavelength and Outposts are infrastructure extensions that run compute near users; they differ from edge caching.

Detailed Notes

What happens at the edge?

Without an edge network, a user in Mumbai fetching an image from a bucket in Virginia crosses many public-internet hops. With CloudFront, the user connects to a nearby edge location; if the object is cached there it is returned in milliseconds, otherwise the edge fetches it from the origin over the AWS backbone and caches it for the next user.

text
User --(few ms)--> Edge location --(cache HIT)--> response
                        |
                   cache MISS
                        v
                 Regional Edge Cache --> Origin (S3 / ALB / EC2)

Services that use the edge

ServiceWhat it does at the edgeTypical exam trigger
Amazon CloudFrontCDN: caching, TLS termination, compression, HTTP/2/3"Reduce latency for global static or streaming content"
Amazon Route 53Authoritative DNS with latency, geo, failover, weighted routing"Route users to nearest Region / failover DNS"
AWS Global AcceleratorAnycast static IPs; routes TCP/UDP over AWS backbone to the closest healthy endpoint"Static IPs, non-HTTP traffic, fast regional failover"
S3 Transfer AccelerationUploads go to the nearest edge, then the backbone to S3"Upload large files to S3 from distant users"
AWS WAF / ShieldFilter web exploits; DDoS protection"Block SQL injection / DDoS at edge"
Lambda@Edge / CloudFront FunctionsRun code on viewer/origin requests and responses"Rewrite URLs, A/B tests, auth at the edge"

CloudFront essentials

  • Distribution = configuration with one or more origins and cache behaviours.
  • TTL: default 24 hours; controlled by Cache-Control headers or behaviour settings. Invalidations remove objects early (first 1,000 paths per month free).
  • Origin Access Control (OAC) keeps an S3 origin private so only CloudFront can read it.
  • Signed URLs / signed cookies restrict content to authorised users.
  • Geo restriction allows or blocks countries.
  • Field-level encryption protects sensitive form fields.
  • HTTPS: free certificates via ACM — for CloudFront the certificate must be requested in us-east-1.

CloudFront vs. Global Accelerator

CloudFrontGlobal Accelerator
Layer / protocolHTTP/HTTPS (L7), cachingTCP / UDP (L4)
CachingYesNo
IP addressesMany changing edge IPs2 static anycast IPs
Best forStatic/dynamic web content, videoGaming, IoT, VoIP, static IP allow-lists, fast multi-Region failover

Extending infrastructure closer to users

OfferingWhat it isUse when
Local ZonesAWS compute/storage/database in a metro area, extension of a parent RegionSingle-digit ms latency for a city (media production, gaming)
WavelengthAWS compute inside 5G carrier networksUltra-low latency mobile apps
OutpostsAWS-managed racks/servers in your data centreLocal processing, data residency, hybrid

Edge caching (CloudFront) and edge infrastructure (Local Zones/Wavelength/Outposts) are different: caches don't run your EC2 or databases.

Example: private S3 origin with CloudFront (Origin Access Control)

json
{
  "Version": "2012-10-17",
  "Statement": [{
    "Sid": "AllowCloudFrontServicePrincipalReadOnly",
    "Effect": "Allow",
    "Principal": { "Service": "cloudfront.amazonaws.com" },
    "Action": "s3:GetObject",
    "Resource": "arn:aws:s3:::my-site-assets/*",
    "Condition": {
      "StringEquals": {
        "AWS:SourceArn": "arn:aws:cloudfront::111122223333:distribution/E1EXAMPLE"
      }
    }
  }]
}

Invalidating cached objects

bash
aws cloudfront create-invalidation \
  --distribution-id E1EXAMPLE \
  --paths "/index.html" "/css/*"

Versioned file names (app.v42.js) are a cheaper, safer alternative to frequent invalidations.

Why it matters

Edge services improve performance (shorter network path, connection reuse), availability (absorb spikes, serve stale content) and security (terminate attacks far from your origin), and often reduce cost since cache hits avoid origin compute and S3 requests.

Real World Example

Scenario — a news publisher survives a viral event.

A global news site stores article images and video clips in S3 in us-east-1 and serves pages from an ALB + EC2 fleet. When a breaking story hits, traffic jumps 40x and readers in Asia complain of slow images.

The engineers put CloudFront in front of both origins. Images and video are cached at edge locations for 24 hours; the HTML is cached for 30 seconds, which shields the origin from most traffic. The S3 bucket becomes private using Origin Access Control, and AWS WAF with a rate-based rule blocks scrapers at the edge. Subscriber-only video uses signed cookies.

For the paid mobile API (non-cacheable TCP traffic) they add Global Accelerator, giving customers two static IPs to allow-list and faster failover between two Regions.

The origin load drops by over 90%, page load time in Asia falls from 4 s to under 1 s, and the next viral story passes without scaling the web tier.

Architecture Diagram

CloudFront edge caching in front of an origin
Architecture
AWS Cloud
Global users
Route 53

Edge location

AWS WAFfilter
CloudFrontcache
Region (origin)
ALBdynamic content
S3 bucketstatic assets (OAC)

Cache hits are served from the edge; misses travel the AWS backbone to the Region.

  1. 1The user's DNS lookup is answered by Route 53 and directs them to the nearest CloudFront edge location.
  2. 2AWS WAF inspects the request and blocks malicious patterns.
  3. 3On a cache hit CloudFront returns the object immediately from the edge.
  4. 4On a miss CloudFront fetches from the S3 or ALB origin over the AWS backbone, caches the response and returns it.

Best Practices

  • ✓Put CloudFront in front of S3 and ALB origins and lock the origin down (OAC for S3, custom header or prefix list for ALB).
  • ✓Cache aggressively with versioned file names and sensible Cache-Control headers instead of relying on invalidations.
  • ✓Compress and use HTTP/2 or HTTP/3; enable Origin Shield for origins with heavy cache-miss load.
  • ✓Attach AWS WAF and Shield to the distribution to stop attacks before they reach the Region.
  • ✓Use signed URLs or cookies for private content, and geo restrictions where licensing demands.
  • ✓Use Global Accelerator for non-HTTP or static-IP needs, CloudFront for cacheable web content.
  • ✓Request ACM certificates for CloudFront in us-east-1.
  • ✓Monitor cache hit ratio and standard logs / real-time logs to tune behaviours.

Common Interview Questions

Exam Tips

SAA-C03 focus

  • "Global users, static/dynamic web content, reduce latency" -> CloudFront.
  • "Static IP addresses / TCP or UDP / fast regional failover" -> Global Accelerator.
  • "Faster uploads to S3 from around the world" -> S3 Transfer Acceleration (or multipart + CloudFront PUT).
  • "Restrict access to S3 so only CloudFront can read" -> OAC (legacy: OAI).
  • CloudFront ACM certificates must be in us-east-1; WAF for CloudFront is created in the global (us-east-1) scope.
  • "Block specific countries" -> CloudFront geo restriction (or WAF geo-match; Route 53 geolocation for DNS).
  • Edge locations cache; Local Zones / Wavelength / Outposts actually run your compute.

Finished this lesson?

0 of 64 lessons done · 0% of the course