Amazon CloudFront is a web service for content delivery. It integrates with other Amazon Web Services to give developers and businesses an easy way to distribute content to end users with low latency, high data transfer speeds, and no commitments.
Questions tagged [amazon-cloudfront]
4907 questions
307
votes
9 answers
When to use Amazon Cloudfront or S3
Are there use cases that lend themselves better to Amazon cloudfront over s3 or the other way around? I'm trying to understand the difference between the 2 through examples.

Kamo
- 3,547
- 2
- 19
- 20
266
votes
5 answers
How to choose an AWS profile when using boto3 to connect to CloudFront
I am using the Boto 3 python library, and want to connect to AWS CloudFront.
I need to specify the correct AWS Profile (AWS Credentials), but looking at the official documentation, I see no way to specify it.
I am initializing the client using the…

Nader A. Jabbar
- 2,856
- 2
- 12
- 7
197
votes
6 answers
Serving gzipped CSS and JavaScript from Amazon CloudFront via S3
I've been looking for ways of making my site load faster and one way that I'd like to explore is making greater use of Cloudfront.
Because Cloudfront was originally not designed as a custom-origin CDN and because it didn't support gzipping, I have…

Donald Jenkins
- 3,485
- 8
- 33
- 35
175
votes
15 answers
AWS CloudFront: Font from origin has been blocked from loading by Cross-Origin Resource Sharing policy
I'm receiving the following error on a couple of Chrome browsers but not all. Not sure entirely what the issue is at this point.
Font from origin https://ABCDEFG.cloudfront.net has been blocked from loading by Cross-Origin Resource Sharing policy:…

Dallas Clark
- 4,064
- 3
- 30
- 36
156
votes
13 answers
Force CloudFront distribution/file update
I'm using Amazon's CloudFront to serve static files of my web apps.
Is there no way to tell a cloudfront distribution that it needs to refresh it's file or point out a single file that should be refreshed?
Amazon recommend that you version your…

Martin
- 5,197
- 11
- 45
- 60
143
votes
13 answers
How do you set a default root object for subdirectories for a statically hosted website on Cloudfront?
How do you set a default root object for subdirectories on a statically hosted website on Cloudfront? Specifically, I'd like www.example.com/subdir/index.html to be served whenever the user asks for www.example.com/subdir. Note, this is for…

wyer33
- 6,060
- 4
- 23
- 53
109
votes
9 answers
Correct S3 + Cloudfront CORS Configuration?
My application stores images on S3 and then proxies them through Cloudfront. I'm excited to use the new S3 CORS support so that I can use HTML5 canvas methods (which have a cross-origin policy) but can't seem to configure my S3 and Cloudfront…

kateray
- 2,066
- 4
- 18
- 23
107
votes
10 answers
CloudFront distribution not showing as Route53 alias target
I’m trying to add a route 53 record set that points to my cloudfront distribution. However, when I select ‘create record set’ in route 53 and click the alias target in the subsequent panel, the cloud front distribution is not listed. All I get is…

LDJ
- 6,896
- 9
- 52
- 87
105
votes
17 answers
Unable to select Custom SSL Certificate (stored in AWS IAM)
I am going to create a new distribution at CloudFront. Already I have uploaded my SSL certificate at AWS IAM using AWS CLI. That certificate appears in the Custom SSL Certificate dropdown on new distribution page but it is DISABLED.
Can someone tell…

theGeekster
- 6,081
- 12
- 35
- 47
96
votes
5 answers
AWS CloudFront redirecting to S3 bucket
I have created a CloudFront distribution to serve the static website. S3 is origin server.
Now if we access CloudFront URL, it redirects to S3 location.
d2s18t7gwlicql.cloudfront.net
or
test.telekha.in
In the browser it is…

Rajneesh
- 2,185
- 4
- 20
- 30
93
votes
5 answers
HTTPS for Amazon S3 static website
I want to host a HTTPS-only static website using Amazon S3 and CloudFront. Here's what I've done so far:
Set up an S3 bucket for static website hosting and put my website files in it
Created a CloudFront distribution and pointed it to the S3…

jamix
- 5,484
- 5
- 26
- 35
84
votes
13 answers
AWS cloudfront not updating on update of files in S3
I created a distribution in cloudfront using my files on S3.
It worked fine and all my files were available. But today I updated my files on S3 and tried to access them via Cloudfront, but it still gave old files.
What am I missing ?

Jigar Tank
- 1,654
- 1
- 14
- 24
84
votes
2 answers
Cloudfront redirect www to naked domain with ssl
Forgive me if this has been asked before, there are a number of resources that touch on this, but nothing seems to fit for my specific (https) use-case.
I'm trying to redirect https://www.example.com to https://example.com. Likewise, this should…

Marc Greenstock
- 11,278
- 4
- 30
- 54
84
votes
4 answers
What is a TTL 0 in CloudFront useful for?
Some weeks ago Amazon announced that they have lowered the content expiration period:
Amazon CloudFront Lowers Minimum Content Expiration Period
So much that you can actually set now TTL in CloudFront to 0. So my question is, why could it be useful…

jatorre
- 1,025
- 1
- 8
- 6
82
votes
12 answers
CloudFront + S3 Website: "The specified key does not exist" when an implicit index document should be displayed
I've just deployed a static website to Amazon S3, which can currently be viewed here: http://www.rdegges.com.s3-website-us-east-1.amazonaws.com/
If you click any of the article links, you'll notice the following error:
S3 is complaining the file…

rdegges
- 32,786
- 20
- 85
- 109