Amazon CloudFront is a delivery service for content.
In cloud computing terms, AWS is a content delivery network (CDN). A CDN uses a network of edge locations to bring content closer to users based on their location. This makes content load even faster for the user.
CloudFront is not just for websites. It is commonly used for delivering website content, it can also be used to distribute a wide range of data, like live video calls or API responses*.
*API responses are data that APIs send to apps. For example, your phone's weather app gets data from a weather service's API. When you open the app and ask for the weather in your city, the app sends a request to the API. The API response is the current weather, e.g. "It's sunny, 23°C."
For example, let's say we're hosting a website in Sydney:
Our customers all the way in Ireland will have to wait a little longer to see of our website's images and videos on their computer. This is because our image/video data has to be sent from AWS' Sydney data centres all the way to their computer in Ireland.
If we also store a copy of our content with CloudFront in the Dublin Region, our customers in Ireland will be loading content from a location closer to them. This means much shorter wait times!
How does this magic happen? They key word to learn in caching.
Caching= storing frequently accessed data/resources temporarily in a faster, easily reachable location.
It's like keeping a copy of a book on your desk for quick access, instead of going to the library every time you need it.
People love caching, because it provides quicker access to information, which is especially useful for speeding up websites and applications.
Amazon CloudFront uses caching to speed up the delivery of content to users.
CloudFront doesn't actually store your content in edge locations from the get go. It waits for users to request content first.
When a user requests a file, CloudFront does a quick check to see if it has a cached copy of that file in the edge location.
If it finds a cached copy, CloudFront delivers it directly to the user.
But if it doesn't have a copy - off it goes retrieving it from the host EC2 server. It'll then cache the retrieved content in the edge location for future requests.
If your business needs to use AWS services in their own building, AWS Outposts arefully operational mini Regions right inside their own data centre. Outposts are owned and operated by AWS, using 100% of AWS functionality, but isolated within your own building. Your on-premise location will get a consistent and seamless hybrid cloud experience, with access to native AWS services like EC2, RDS and S3.