
Ask HN: Do you use a CDN for your API delivery needs? - dedalus
Usually CDN is used for static content without doubt but I want to know if people use it for their apis<p>Specifically because:
  - Rate Limiting is involved
  - Token Checking&#x2F;Basic Auth is somehow involved
et<p>If you do use a CDN let me know which one is used
======
rustyconover
Using a CDN for an API is also a good idea if the CDN allows large content
uploads to be faster than commodity/cloud hosting. Cloudfront speeds up
uploads to S3 in some circumstances on some networks (looking at you FIOS),
because in some cases Cloudfront edge locations have direct connections to the
various S3 regions instead of going over the commodity internet. This is why
Cloudfront charges 0.02 a gig for uploads.

Furthermore, using a CDN in this way may be a good idea because you don't have
to worry about front end server noise/internet traffic. Cloudfront does have a
good record of keeping up to date with SSL, and other various upgrades. By
using Cloudfront's behavior rules I can have some requests go to backend
servers via an ELB, others go to S3 and still others to go to other places.
The end user has no idea, the simply see the same URL that they always do. It
is nice to have everything all neatly wrapped under one URL structure and not
to have to worry about DNS or cross domain antics.

And if I wanted to do access control I can easily use Cloudfront's support for
signed requests[1]. That way if a request comes into to a particular URL path
I can require that it be signed or not. Hence eliminating requests to resource
intensive parts of the application.

[1] -
[http://docs.aws.amazon.com/AmazonCloudFront/latest/Developer...](http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-
content-signed-urls-overview.html)

~~~
dedalus
Thank you. This is very helpful

