From Dev.to
The file you generate is a memory budget, not a format: streaming PDFs, images and ZIPs under a hard ceiling
An endpoint that turns a database query into a downloadable file is one of the few places where your code touches every byte it produces. Most handlers do work on a few kilobytes of JSON and forget it...
