Tag Info

Hot answers tagged

8

You have to use the API to create a DistributionConfig that uses CustomOrigin (rather than S3Origin). Some documentation on how to do so here: http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/index.html?DistributionConfigDatatype.html#CustomOriginChildElements Then you have to create a Distribution using that DistributionConfig: ...


8

Sure -- it's called "Economic Denial of Sustainability". Not a huge amount you can do about it. Don't expect any CDN provider that bills by the byte to aggressively deploy any countermeasures, either, because it's in their interest to serve (and bill you for) as much traffic as possible.


8

Yes. CloudFront has lower latencies than S3 even when the request originates from a non-edge location. Generally, CloudFront responds tens of milliseconds faster. Whether you care about such small differences is a separate question. References: http://www.quora.com/What-are-typical-latencies-for-static-content-in-S3-vs-Cloudfront ...


8

As of March 2014, Amazon CloudFront supports SNI, at no additional cost, see details here. This will allow you to use your ssl certificate on CloudFront, without paying $600 monthly. Please note that SNI is not supported by (extremely) old browsers (pre-IE7, pre-Chrome6, pre-FF 2), see details in link above.


7

[Note: This answer was correct up until March 2014] No, this is not possible with CloudFront. The user will hit the mismatched certificate before CloudFront processes the request because of the natures of DNS and SSL. You might consider CloudFlare's SSL offering.


7

I believe the answers so far, while correct at the time, are now out of date, as Cloudfront now supports a minimum TTL of 0, and the OP's original attempt to use cache-age=0 should now work. You would want to look into whether to use those other cache-control headers, in terms of whether they will produce the result you are looking for - you may only need ...


6

Now-a-days you can setup Custom Origin via the AWS Web console.


6

It is possible. However, one purpose of a CDN is scalability. You can expect the CDN to perform the same if you throw 100 visits at once or 1 million visits at once. As far as your setup goes, there's nothing that I can know with the information you provided, but I think that the point above is what makes a CDN so valuable. If you're creating a site that ...


6

You don't have to use S3 as the origin for a CloudFront distribution, you can specify an arbitrary HTTP server. There are some limitations however; from the CloudFront documentation: A custom origin is an HTTP server, for example, a web server. The HTTP server can be an Amazon EC2 instance or an HTTP server that you manage privately. When you use a ...


6

It's true that Cloudfront does not charge for storage, but here is the point you are misinterpreting: my files will be copied to many geographically distributed data centers. Incorrect. Cloudfront has dozens of edge locations around the globe, but your content is not exactly copied to them. Instead, when a browser tries to fetch one of your ...


6

I ran into this problem recently and I found a workaround that seemed to work. I created a Cloudfront distribution with a custom origin pointing to the S3 static website hostname instead of the bucket hostname. In the OP's case, the desired origin would be. mysite.s3-website-us-east-1.amazonaws.com Hitting a Cloudfront distribution just using the bucket ...


5

CloudFront requests come from the documented IP ranges as well as with a User-Agent string that includes Amazon CloudFront. You can block either, but with AWS's IP ranges expanding fairly frequently I'd go with the User-Agent block.


5

This is handled with the regular HTTP cache control mechanisms (see RFC 2616) as documented in Amazon CloudFront Object Expiration, specifically: By default, each object automatically expires after 24 hours. To specify a different expiration time, configure your origin to add a value for either the Cache-Control max-age directive or the Expires header ...


5

Firstly, the point of Cloudfront is to serve cached content - if you try to serve uncached content from Cloudfront it is slower than serving it directly from S3, in almost all cases (something like streaming content would be the exception). Consider for a moment what needs to happen to serve content from Cloudfront - it needs to be retrieved from the origin ...


4

Cloudfront does not support the referrer header, so you can't directly do this. One approach to dealing with hotlinking though, is to generate signed URLs that expire after a short time. Essentially, with a dynamic page, you make all your Cloudfront content private, and then use a signed URL to embed the image in your page. The signed URL grants access to ...


4

The file isn’t necessarily cached on all of CloudFront’s edge servers. You may have retrieved the file from one location the first time, and a different edge server the second time. You can see where the file is coming from by examining the Via HTTP header, which you can view by doing: curl -i http://your.url/.


4

You certainly would see some benefit from using a CDN I'm sure, but it does depend on what the cause of speed problems are on the server. Anything you offset from your server would speed things up, particularly give the geographical nature of a CDN. Are people suffering slow speeds due to latency or because your bandwidth is routinely getting saturated, or ...


4

If you're accessing the root of your CloudFront distribution, you need to set a default root object: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DefaultRootObject.html To specify a default root object using the CloudFront console: Sign in to the AWS Management Console and open the Amazon CloudFront console at ...


4

In order for me to get this working. I had to set the CORS configuration to include the CloudFront distribution domain. I also had to change the settings in my CloudFront distribution behaviors, to Allow forwarding of query strings. I cant recall where I saw that was a requirement. I then invalidated the fonts causing the issues. Then we were good to ...


4

You should construct your HTML to use a different URL hostname for static content. Use firebug to take a look at any big web company's main content. Facebook (for example) uses http://static.ak.fbcdn.net for static content that I'll assume is using Akamai. (another CDN like Cloudfront) other less static content comes directly from facebook.com. You can ...


4

I don't believe so. Why would you need to do this, though? Cloudfront is merely a CDN front-end to your static data, which is most likely being hosted out of your S3 bucket. There should be no need to interact with the data in Cloudfront other than to expire objects from the cache, which can be done through the Cloudfront API or by setting proper HTTP ...


3

You need to set the ACLs on your S3 objects so that they're world readable. By default they're not.


3

"Your" Cloudfront distribution is not a single thing at a single place. It's a virtual entity on a global distributed network, and the more places from which it is being accessed, the more potential IP addresses you may see, because the requests are routed to the requester's nearest endpoint, using DNS. If I access your distribution, that's going to ...


3

First thing, you need to make sure that you whitelist origin header: If you want CloudFront to respect cross-origin resource sharing settings, configure CloudFront to forward the Origin header to your origin. http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/RequestAndResponseBehaviorCustomOrigin.html#request-custom-cors Also see: ...


3

Tested & Working on httpd-2.2.3-31.el5.centos Redirect Method: RewriteEngine On RewriteCond %{REQUEST_URI} .*jpg$|.*gif$|.*png$ [NC] RewriteRule (.*) http://www.google.com/$1 [R] The R will cause the page to actually redirect to the new domain, which may or may not be exactly what your looking for. Proxy Method: RewriteEngine On RewriteCond ...


3

You can enable logging in Cloudfront, which will generate a log file containing a list of requests (and placed into an S3 bucket). You can then parse those log files as you would with server logs to determine the files, IPs, or even edge servers using the most bandwidth. There are also a few programs that will provide information about the logs - I believe ...


3

Amazon CloudFront (mostly) obeys the regular HTTP cache control mechanism (see RFC 2616) as documented in Amazon CloudFront Object Expiration, specifically: You can specify a longer expiration time by using the Cache-Control, Pragma, or Expires header on the object in the origin server. [...] CloudFront does not restrict their maximum values. ...


2

I would serve the less popular videos straight off S3. YouTube doesn't start serving videos off their CDN until a video hits 300 views. I would track the time of the last x many views of videos storing a list in something like Redis, and if the the x'th last view was within a certain time frame, only then serve the video off CloudFront.


2

You could restrict access to the published Amazon CloudFront Public IP Ranges; however, be aware of the respective disclaimer by Amazon: The CloudFront IP addresses change frequently and we cannot guarantee advance notice of changes. On a best-effort basis, we will provide the list of current addresses. Customers should not use these addresses for ...


2

This is a license limit set by Adobe: I don't work for Adobe but can confirm that these limits are imposed by them. It basically means that for using the P2P feature in FMS you have certain connection limits imposed depending on instance type. Even though Flash Player clients connect to one another in a P2P mode they also hold a connection open to FMS to ...



Only top voted, non community-wiki answers of a minimum length are eligible