Why is it not recommended to serve static files from Node.js?

View other answers to this thread
Start a personal dev blog on your domain for free and grow your readership.

3.4K+ developers have started their personal blogs on Hashnode in the last one month.

Write in Markdown · Publish articles on custom domain · Gain readership on day zero · Automatic GitHub backup and more

Allan Ebdrup's photo

If you have a public facing app, another option that I think is preferable to sending static files from nginx, is setting up a CDN proxy (like Amazon cloudfront). It's much easier to set up, performs (much) better across the world, and you can keep deploying your app/website as though it's one app. Just cache everything forever, and give files a new URL when you change them.