20
loading...
This website collects cookies to deliver better user experience
http://<bucket-name>.s3-website-<AWS-region>.amazonaws.com
{"Version":"2012-10-17",
"Statement":[{
"Sid":"PublicReadGetObject",
"Effect":"Allow",
"Principal": "*",
"Action":["s3:GetObject"],
"Resource":["arn:aws:s3:::S3_BUCKET_NAME_GOES_HERE/*"]
}]
}
Maximum Time-to-Live (TTL): CloudFront will typically serve cached content from an edge location until the content expires. After it expires, the next time that content is requested by an end user, CloudFront goes back to the S3 origin server to fetch the content and then cache it. CloudFront edge locations automatically expire content after Maximum TTL seconds elapse (by default, this is 24 hours).
Minimum TTL: expiration could be sooner because CloudFront reserves the flexibility to expire content if it needs to, before the Maximum TTL is reached. By default, the Minimum TTL is set to 0 (zero) seconds, but this value is configurable. Therefore, CloudFront may expire content anytime between the Minimum TTL (default is 0 seconds) and Maximum TTL (default is 24 hours).
Content Versioning: every time you update website content, embed a version identifier in the file names. It can be a timestamp, a sequential number, or any other way. For example, instead of banner.jpg, call it banner_v1.jpg. When you update the image, name the new version banner_v2.jpg and update all files that need to link to the new image. Since new file names are involved, CloudFront immediately fetches the new files from Amazon S3 (and afterwards, cache them).
Cache-Control Headers: You can manage CloudFront expiration behavior by specifying Cache-Control headers for your website content. If you keep the Minimum TTL at the default 0 seconds, then CloudFront honors any Cache-Control: max-age HTTP header that is individually set for your content. If an image is configured with a Cache-Control: max-age=60 header, then CloudFront expires it at the 60 second mark. This gives you more precise control over content expiration for individual files.
CloudFront Invalidation Requests: are a way to force CloudFront to expire content. Invalidation requests aren’t immediate. It takes several minutes from the time you submit one to the time that CloudFront actually expires the content.
20