Amazon CloudFront service is a content delivery network service (CDN) which enables faster delivery of dynamic or static content web pages or streaming content resources to the end users who request them from different physical locations around the globe located far away from the origin servers where the original content are files present.
Amazon CloudFront uses Edge Locations around the globe to cache these web resources so that it can be served to the end customer who is nearest to one of the Edge Location. These files are cached in the Edge Locations from the origin servers which stores the original definitive content as the source (which can be an Amazon S3 bucket or HTTP web server or an EC2 instance or an Elastic Load balancing). When the end user requests for a file, web page the request is redirected to the nearest Edge location. However, if the resource is not present, CloudFront checks in Origin server and caches the object at the Edge Location and delivers the content. The objects in the cache also have an expiry time and once they reach that time, CloudFront checks if there is an updated copy in the origin servers and replaces the new content in the Edge Location.
The end user can get the webpages delivered faster through CloudFront. Also, any updates done to the resources in the Edge Location is propagated back to the Origin servers by the CloudFront. And this newly updated content is again distributed to other Edge Locations.
CloudFront lets you restrict content through signed URLs and signed cookies. Also, it supports to restrict delivery of content based on geographical location. Security being of utmost importance to Amazon, CloudFront integrates seamlessly with other Amazon services like AWS WAF(Web Application Firewall), AWS Shield and Route 53.
CloudFront has the capability to detect the end user device(Mobile, desktop, Tablet etc) from which he/she is trying to access the web resources and delivers content based on that. It supports HTTP methods like GET, POST, PUT, HEAD, DELETE, OPTIONS and PATCH. However do remember that CloudFront only caches responses to GET and HEAD requests and, optionally, OPTIONS requests. It does not cache responses to DELETE, POST, PATCH or PUT requests. They are directed to the origin server.