Reputation: 3105
So I am starting to maxcdn cdn service, right now I put as origin my s3 bucket Endpoint so when there is a miss in the cdn it will pull the file from s3.
Will it be smart to enable CloudFront for this bucket, and make maxcdn to pull the files from CloudFront? so it will be "double cdn"
like maxcdn(miss?)->CloudFront(miss?)->s3
Am I right in my assumption that is useless cause if there is a miss in maxcdn probably it also gonna miss CloudFront?
Upvotes: 0
Views: 495
Reputation: 179442
It seems a little unusual, but it's probably worth trying.
A sometimes overlooked benefit of pairing S3 with CloudFront is that, even when the request results in a cache miss (as well as for uploads, where relevant), the traffic between S3 (or EC2, any origin server inside AWS) and CloudFront is transported on a high-performance IP network owned and managed by Amazon.
The data has to be transported from S3 to the 3rd party CDN over the distance from S3 to the other CDN's requesting edge node, and running the requests through CloudFront will tend to cause the traffic to spend more of that distance on the global Amazon network than it might have if the requests were being made to S3 directly. This should mitigate some of the vagaries and variables involved in traversing large distances across the Internet, and should equate to some kind of performance advantage, though it might be somewhat subtle and difficult to quantify. It's hard to speculate.
CloudFront in the middle also changes the pricing you will pay for download bandwidth. If you connect directly the remote CDN to S3 as it's origin, your per-gigabyte AWS bandwidth charges for transport are based only on the S3 region, and this is a charge that is different among regions -- but your bucket is only in one region, and that region's charges will apply to all transfers.
But download transport between S3 and CloudFront is free, so your download bandwidth charges are based on the CloudFront edge location the remote CDN uses to fetch the content. This price also varies by region, and you can further control price/performance with the CloudFront pricing classes. In some cases, the bandwidth charges from CloudFront are lower than the charge for accessing S3 directly, but in other cases, they are higher.
Whether cache misses on the remote CDN are likely to correspond with cache misses on CloudFront is highly dependent on the global distribution of your site visitors, and of the number, distribution, and routing, of the remote CDN's edge locations, and how MaxCDN handles eviction of unpopular objects (and how CloudFront does, as well). MaxCDN appears to have fewer edge locations than CloudFront, so the odds of a MaxCDN cache miss coinciding with a CloudFront cache miss seems fairly high.
Still, it's easy enough to try it, and you can analyze the CloudFront stats and logs to determine how it's interacting.
Upvotes: 3