|
|
|
|
|
by sylvain_kerkour
1886 days ago
|
|
Hi,
I faced this situation after a Show HN (https://news.ycombinator.com/item?id=20105567), all I had to do is simply to add a CDN (Cloudflare or AWS Cloudfront) in front of the servers in order to serve the static assets and pages from the CDN, and the API requests by the servers. If you are not familiar with CDNs yet, learn how works the Cache-Control HTTP header (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Ca...) so you can send a different header for API responses than for static assets responses. Then learn how to purge the CDN after each release. I would recommend to start with Cloudflare as it's cheaper, and easier to use. A CDN with correct Cache-Control headers and Heroku Autoscaling should bring you very far in term of traffic you can handle. |
|
I would cache most of the common database queries, then monitor which is pulling down your system. A load balancer usually does the trick.
[1] - https://arbeitnow.com