Amazon CloudFront is a global Content Delivery Network(CDN)service.It integrates with other AWS products to give developers and businesses an easy way to distribute content to end users with low latency,high data transfer speeds,and no minimum usage commitments.
Amazon CloudFront is AWS CDN.It can be used to delivery our web content using Amazon’s global network of edge locations. When a user requests content that you’re serving with Amazon Cloud Front,the user is routed to the edge location that provides the lowest latency(time delay),so content is delivered with the best possible performance. If the content is already in the edge location with the lowest latency,Amazon Cloud Front delivers it immediately.If the content is not currently in that edge location,Amazon CloudFront retrieves it from the origin server,such as an Amazon Simple Storage Service(Amazon S3)bucket or a web server,which stores the original, definitive versions of your files.
Amazon CloudFront is optimized to work with other AWS cloud services as the origin server, including Amazon S3 buckets,Amazon S3 static websites,Amazon Elastic Compute Cloud(Amazon EC2),and Elastic Load Balancing.Amazon Cloud Front also works seamlessly with any non-AWS origin server,such as an existing on-premises web server.Amazon Cloud Front also integrates with Amazon Route 53
Amazon CloudFront Basics
Below are the concepts,we can easily use CloudFront to speed up delivery of static content from your websites.
- Cache control
Distributions:To use Amazon CloudFront,you start by creating a distribution,which is identified by a DNS domain name such as d111111abcdef8. cloud front.net. To serve files from Amazon CloudFront,yousimplyusethedistributiondomainnameinplaceofyourwebsite’sdomainname; the rest of the file paths stay unchanged.
Origins:When you create a distribution,you must specify the DNS domain name of the origin-the Amazon S3 bucket or HTTP server-from which you want Amazon CloudFront to get the definitive version of your objects(web files).
Cache Control:Once requested and served from an edge location,objects stay in the cache until they expire.By default,objects expire from the cache after 24 hours.
Signed URLs:Use URLs that are valid only between certain times and optionally from certain IP addresses.
Signed Cookies:Require authentication via public and private key pairs.
Origin Access Identities(OAI):Restrict access to an Amazon S3 bucket only to a special Amazon Cloud Front user associated with your distribution.This is the easiest way to ensure that content in a bucket is only accessed by Amazon CloudFront.
Creating a Cloudfront Distribution: (Mostly am choosing all the default options)
- We can find the CloudFront distribution under“Network&Content Delivery”
2. Choose a delivery method for content(Web or RTMP).
3. Choose the“Origin Settings”as below.
4. Choose the Default Cache Behaviour Settings
5. Choose the Distribution Settings.
6. For Cloudfront we will get a domain name In this form at http://d111111abcdef8.cloudfront.net/.We can access the Objects with Cloud front distribution,the objects are going to deliver from near by edge location.
More Information :https://fgrade.com/amazon-web-services/