Static files and CDNs

We are currently using Express' static app to serve our JavaScript and CSS. A best practice for scalable sites is to push any static content onto a Content Delivery Network (CDN). If you have ever used Facebook (they do have a pretty large user base), you have used a CDN. If you inspect your Facebook profile, you will see a domain come up again and again, fbstatic-a.akamaihd.net. This is the CDN that Facebook uses for static assets. A CDN will have multiple servers across the world with the same content. Based on where the request comes from, the CDN will return the closest source. We are going to do something similar with this application using Amazon Simple Storage Service (S3).

Note

Some of you out there might say S3 is ...

Get Building Scalable Apps with Redis and Node.js now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.