diff --git a/CloudFront/_CloudFront.md b/CloudFront/_CloudFront.md index 55e5c09..114f664 100644 --- a/CloudFront/_CloudFront.md +++ b/CloudFront/_CloudFront.md @@ -15,7 +15,7 @@ **Regional Caches**: Compute located in board geographical locations to speed up requests for edge locations. **Distribution**: A collection of Edge locations and Regional Cache that defines how cached content should behave. -## [[Lambda@Edge]] and [[CloudFront Functions]] +## Stages where [[Lambda@Edge]] and [[CloudFront Functions]] can trigger The order that the functions trigger within CloudFront is: | Order | Stage | L@E | CF Fns | Description | Example Use Cases | |--|---|---|---|---|--| @@ -36,3 +36,18 @@ sequenceDiagram Edge->>Viewer: Viewer Response ``` +## Difference between [[Lambda@Edge]] and [[CloudFront Functions]] +| | CF Fns | L@E | +|---|---|---| +| Programming Languages | JavaScript (ECMAScript 5.1) | Node.JS and Python | +| Event Sources | Viewer only | Viewer and Origin | +| Scale | +10,000,000 requests/s | 10,000 requests/s/Region | +| Function Duration | Submilisecond | Up to 5s (Viewer) / Up to 30s (Origin) | +| Max Memory | 2MB | 128MB-3,008MB | +| Max Bundle Size | 10KB | 1MB (Viewer) / 50MB (Origin) | +| Network, File System, and Request Body Access | ❌ | ✔️ | +| Access to geolocation | ✔️ | ❌ (Viewer request) / ✔️ (Origin request & response, Viewer response) | +| Can build/test entirely within CloudFront | ✔️ | ❌ | +| Functions logging and metrics | ✔️ | ✔️ | +| Pricing | Cheaper. Free tier available; charged pre request. | More expensive. Charged per request & function duration. | +