Serving static files fast
Static files are the cheapest thing to serve well and a common thing to serve badly. The trick is to let the web server send them and keep your application out of the way.
Do not route files through your app
Reading a file through your application code wastes a process on something the web server does far better. Hand static paths to the web server directly, and reserve your application for requests that actually need logic.
Cache headers do the heavy lifting
Tell browsers and proxies how long they may keep a file, and most repeat requests never reach you at all — see cache-control headers. Fingerprint filenames so you can cache aggressively and still update instantly.
Offload the big and the popular
For large downloads or a global audience, a cache in front spares your bandwidth and shortens the distance to the user — caching and a CDN. The less your origin has to send, the more headroom it keeps for real work.
Still stuck? Mail support@novogara.com — an engineer answers, at any hour. Back to the knowledge base