Amazon CloudFront

 Amazon CloudFront



Amazon cloudfront is CDN (Content Delivery Network) service that allows to serve your content with little or no delay effortlessly. The content copied to the edge locations all over the world. Edge location is a site that AWS uses to cache contents to improve latency. So when user access the content he/she will receive it from the closest AZ (Availability Zone).

This is how it works :

We provide CloudFront origin, it can be S3 bucket files (for example: html, pdf etc.) or another origin such as web app. you run on EC2 instance or a Load Balancer. So after that CloudFront starts caching them in Regional Edge Cache and those propagated to Edge Locations as well. So by that your content becomes globally available. CloudFront reduces latency and improves performance.

You can also utilize AWS Shield (DDOS protection) and WAF (web threat protection) technologies to protect your resources.

Let's create simple web page and serve it over S3 bucket. And use CloudFront as CDN so our webpage will load faster.


  1. Create one S3 bucket with public access. Check the steps here :

    https://www.learn-aws.com/2024/11/s3-create-static-website.html

  2. After that let's configure CloudFront specifically for this purpose.






  3. Select the bucket public address from list. And make sure you clicked "Use website endpoint" button. 



  4. Make sure caching preferences look like the one below.





  5. Make sure "Last modified" part has date/time, if it is in "Pending" state thin means you have to wait more to content propagate fully.



  6. When you navigate to the address, will be able to see your page content.







 

  

 

Comments

Popular posts from this blog

S3 - Create a static website

AWS - Databases DynamoDB, RDS

S3