AWS CloudFront: CDN Cloud Service (original) (raw)

Last Updated : 8 Jun, 2026

AWS CloudFront is Amazon’s high-performance Content Delivery Network (CDN) service designed to accelerate the delivery of static and dynamic web content to users worldwide. CloudFront caches files in a global network of data centers. This dramatically reduces latency and improves load times.

aws_shied

AWS CDN

Core Components

AWS CloudFront consists of three main architectural components:

Content Delivery Workflow

The step-by-step process of delivering content to users globally is described below:

  1. **User Request: A user requests a specific file (e.g., logo.jpg) from your website.
  2. **DNS Routing: The request is routed by DNS to the closest CloudFront Edge Location.
  3. **Cache Check: The local Edge Location checks its cache for the requested file.
  4. **Cache Hit: If the file exists in the cache, CloudFront immediately delivers it to the user.
  5. **Cache Miss: If the file is missing, the Edge Location forwards the request to the Origin server.
  6. **Origin Response: The Origin server sends the requested file back to the Edge Location.
  7. **Cache and Deliver: The Edge Location caches the file for future requests and delivers it to the user.

Aditya_Ramesh_AWS_Cloudfront

CloudFront Step-by-Step Delivery Process

Key Features

Lambda@Edge vs. CloudFront Functions

Custom logic can be executed closer to users to modify request and response data at the edge.

**Feature **CloudFront Functions **Lambda@Edge
**Best For High-volume, simple logic (URL/Header). Complex logic, API calls, and Image processing.
**Runtime Restricted JS (ES6/2.0 runtime). Full **Node.js and **Python.
**Max Duration ****< 2ms** (strict limit). Up to **5s (Viewer) / **30s (Origin).
**Max Memory **2 MB. 128 MB (Viewer) up to 10 GB (Origin).
**Network Access **No (Isolated sandbox). **Yes (Can call external APIs/DBs).
**Triggers Viewer Request/Response only. All 4 (Viewer/Origin Request/Response).
**Cost ~$0.10 per 1M requests. ~$0.60 per 1M requests + Duration.

AWS CloudFront and WAF Integration

AWS CloudFront integrates with AWS Web Application Firewall (WAF) to block malicious traffic at the edge before it reaches origin servers.

Web ACL Configurations

Web ACLs allow developers to filter traffic based on several request characteristics:

Benefits of AWS WAF and CloudFront Integration

Use Cases

AWS Content Delivery Network is widely adopted across various application architectures:

CloudFront vs. AWS Global Accelerator

A comparison of CloudFront and AWS Global Accelerator highlights their different architectural targets:

Feature AWS CloudFront AWS Global Accelerator
Purpose Focuses on content caching Focuses on network optimization
Protocol Support Works mainly with HTTP/HTTPS Supports TCP and UDP
Routing Method Uses edge caching Uses AWS global backbone routing

CloudFront vs. Other CDNs

The key differences between AWS CloudFront and alternative content delivery networks are summarized below:

Feature AWS CloudFront Alternative CDNs (e.g., Cloudflare, Akamai)
Provider Type Amazon Web Services (AWS) Independent providers specializing in global content routing
Integration Tightly integrated with AWS ecosystems like S3, WAF, Route 53, and Lambda Compatible across multi-cloud and diverse hosting environments
Customization Offers extensive customization options via edge computing scripts Provides standard out-of-the-box configurations and add-ons

Key Benefits of CDNs

Implementing a Content Delivery Network offers several operational advantages:

AWS CloudFront Pricing

The operational cost structure of AWS CloudFront depends on several components:

**Pricing Component **Description **Estimated Cost
**Data Transfer Out Volume of data sent from edge locations to users over the internet. Starts at $0.085 per GB for the first 10 TB/month in the U.S. and Europe regions.
**HTTP/HTTPS Requests The quantity of request messages processed at edge locations. Approximately 0.0075per10,000HTTPrequestsand0.0075 per 10,000 HTTP requests and 0.0075per10,000HTTPrequestsand0.0100 per 10,000 HTTPS requests in the U.S. region.
**Invalidation Requests The manual removal of objects from cache prior to expiration. First 1,000 invalidation paths free each month, then $0.005 per path.
**Real-Time Logs Continuous logs delivered to streaming systems. Typically billed at $0.01 per 1,000,000 log lines.
**Origin Shield Centralized caching layer to protect origin capacity. Approximately $0.0075 per 10,000 requests in the U.S. region.