Fixes the reported memory leaks when fetching media.
Memory Leak with Blob/ArrayBuffer and Bun's Garbage Collection
// Proposal for new feature Bun.serve({ async fetch(req) { const file = Bun.file("./bun.mp4"); // Optimized built-in method return new Response(await Bun.serveVideo(file, req)); }, }); Use code with caution. Copied to clipboard bun.mp4
Bun does not support streaming videos with range requests #10440
Removes the need to manually manage 206 Partial Content headers. If you can tell me: Fixes the reported memory leaks when fetching media
It would utilize a optimized stream pipeline to prevent memory leaks, resolving issues where large video fetches fail to release memory.
Do you need to support (transcoding) or just streaming ? I can refine this feature proposal further. If you can tell me: It would utilize
To create a feature that addresses this within the Bun runtime context, I propose a new , specifically optimized to handle partial content requests, automatic range header parsing, and efficient memory management to prevent leaks, as described in Github discussions. Proposed Feature: Bun.serveVideo 1. Functionality: