CloudFront CheatSheet

  • CloudFront is a CDN (Content Distribution Network). It makes website load fast by serving cached content that is nearby
  • CloudFront distributes cached copy at Edge Locations
  • Edge Locations aren’t just not read-only, you can write to them eg. PUT objects
  • TTL (Time to live) defines how how long until the cache expires (refreshes cache)
  • When you invalidate your cache, you are forcing it to immediately expire (refreshes cached data)
  • Refreshing the cache costs money because of transfer costs to update Edge Locations
  • Origin is the address of where the original copies of your files reside eg. $3, EC2, ELB, Route53
  • Distribution defines a collection of Edge Locations and behaviour on how it should handle your cached content
  • Distributions has 2 Types: Web Distribution (static website content) RTMP (streaming media)
  • Origin Identity Access (OAI) is used access private S3 buckets
  • Access to cached content can be protected via Signed Urls or Signed Cookies
  • Lambda@Edge allows you to pass each request through a Lambda to change the behaviour of the response.