CloudFront's Behavior
A CloudFront Behavior defines how Amazon CloudFront handles requests for content at the edge locations. Here are the key aspects:
Path Patterns and Precedence:
Each behavior is associated with a path pattern (like "/images/" or ".jpg")
CloudFront matches the request URL against these patterns in order of precedence
The first matching pattern's behavior settings are applied
Default behavior (*) catches all unmatched requests
Key Configuration Options:
Origin and Origin Protocol Policy
Viewer Protocol Policy (HTTP/HTTPS)
Allowed HTTP Methods
Cache Settings
Compression settings (Gzip/Brotli)
Function associations (Lambda@Edge/CloudFront Functions)
TTL settings (min, max, default)
Cache key settings
Headers/cookies to forward to origin
For example:
Common Use Cases:
Different caching strategies for different content types
API request handling vs static content delivery
Security requirements for specific paths
Different origin sources based on content type
Custom error handling for specific paths
Last updated
Was this helpful?