# Amazon CloudFront

> AWS's CDN: copies of your content kept close to users all over the world.

- Level: Basic
- Topics: AWS
- URL: https://tidbit.legios.com.ar/amazon-cloudfront/
- In Spanish: [Amazon CloudFront](https://tidbit.legios.com.ar/es/amazon-cloudfront/)

**CloudFront** is AWS's CDN (content delivery network). You point it at an **origin** (an Amazon S3 bucket, a load balancer, any web server) and it serves your files from hundreds of **edge locations**: small data centers in cities on every continent. A visitor in Buenos Aires gets your images from an edge nearby instead of from a server in Virginia, so the page loads noticeably faster.

The first visitor near an edge triggers a fetch from the origin; the edge keeps a copy (a **cache**) for as long as you configure and serves everyone else from it. That also protects the origin: a million visitors turn into a handful of requests to your server. CloudFront handles HTTPS with a free certificate, blocks common attacks in front of your site, and charges per gigabyte served.

A common setup is a static website: HTML, CSS and images in an S3 bucket, CloudFront in front, a domain from Amazon Route 53. No server at all, and it holds up fine when a post goes viral.

## An analogy

A bakery chain that bakes once at headquarters and keeps fresh loaves on shelves in every neighborhood. You buy around the corner instead of driving to the factory, and the factory only bakes again when a shelf runs empty.

## Keep in mind

- The origin is where the content lives; the edges keep temporary copies.
- Faster for users and cheaper for the origin: most requests never reach it.
- Includes HTTPS with a free certificate and basic protection against attacks.
- You decide how long each file stays cached (its TTL).

## Go deeper

- [What is Amazon CloudFront? (official docs)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Introduction.html)
- [Amazon CloudFront](https://aws.amazon.com/cloudfront/)

## Related terms

- [CDN](https://tidbit.legios.com.ar/cdn/): Copies of a website kept on servers around the world, close to whoever asks.
- [Amazon S3](https://tidbit.legios.com.ar/amazon-s3/): A giant online drawer for files, rented by the gigabyte.
- [Load balancer](https://tidbit.legios.com.ar/load-balancer/): The traffic cop that spreads incoming requests across many servers.
- [Server](https://tidbit.legios.com.ar/server/): A computer whose job is to answer requests from other computers, all day, every day.
- [Data center](https://tidbit.legios.com.ar/data-center/): A building full of servers where the internet, the cloud and AI actually run.
- [HTTPS](https://tidbit.legios.com.ar/https/): The padlock in your browser: web traffic nobody in between can read.
- [TLS certificate](https://tidbit.legios.com.ar/tls-certificate/): The ID card a website shows your browser to prove it is who it claims to be.
- [HTML](https://tidbit.legios.com.ar/html/): The text format that describes what is on a web page: headings, paragraphs, links.
