How it works...

  1. A user accesses your website or application and requests for one or more objects, such as an image file and an HTML file.
  2. DNS routes the request to the CloudFront edge location that can best serve the user's request, typically the nearest CloudFront edge location in terms of latency, and routes the request to that edge location.
  3. In the edge location, CloudFront checks its cache for the requested files:
    1. If the files are in the cache, CloudFront returns them to the user.
    2. If the files are not available, CloudFront sends the request to the origin server based on the file type. For example, to your Amazon S3 bucket for image files and to your HTTP server, for the HTML files. Then it stores the files to the edge location for the ...

Get AWS Networking Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.