irongit/symfony2-stream-response
A Symfony2 bundle that provides streamed HTTP responses, letting you push large or generated content to the client incrementally instead of buffering it all in memory. Useful for big file downloads, exports, and long-running output where streaming improves performance and reduces memory use.
response()->stream(), streamDownload(), download(), and the underlying Symfony StreamedResponse/BinaryFileResponse) rather than thin third-party wrappers. That default should be a documented engineering standard, not a per-ticket debate.Adoption criteria — all of which would need to be true:
Response subclass (and typically a registered bundle). It does not map onto Laravel's HTTP layer, which consumes Symfony only at the component level.StreamedResponse and BinaryFileResponse demonstrably lack.app/Support/) is demonstrably more expensive than adopting and maintaining a vendored, unmaintained class.Look elsewhere — and the default answer here is "elsewhere" — when:
response()->stream(), response()->streamDownload(), response()->file(), and response()->download() cover the overwhelming majority of delivery needs with zero added dependency.StreamedResponse and BinaryFileResponse are first-party and maintained; Symfony 2 reached end of life in 2018.Last-Modified validators, or resumable downloads. A 2013-era implementation likely lacks byte-range support, and first-party BinaryFileResponse handles it natively.For executives: The capability we care about is delivering large files and generated content — exports, reports, media — without exhausting server memory or timing out PHP workers. The good news is that this capability already ships in the framework we use and requires no new vendor, no new licence, and no new maintenance burden. The package under review is a thin, dormant wrapper around functionality we already own; adopting it would add dependency and security risk while adding zero capability. Recommendation: do not adopt. Standardize on native streamed and binary responses, and capture the underlying requirement (memory-safe large-file delivery) as an engineering standard rather than a procurement decision.
For engineering: Ship streamed and binary responses with first-party primitives — response()->stream(), streamDownload(), download(), and file() in Laravel, backed by Symfony's StreamedResponse and BinaryFileResponse. Treat this package as a design reference only: it confirms the pattern is small enough that in-house implementation is a few dozen lines we fully control and can test. The one insight worth borrowing is mundane but important — close the session and clear output buffers before a long stream — and it belongs in a team-owned StreamedDownloadResponse class or middleware with tests, not in a dependency. Where files already live on disk or in object storage, push delivery to the edge (X-Accel-Redirect, X-Sendfile, presigned URLs) rather than streaming through PHP at all. Finally, adopt a lightweight dependency gate — maintenance activity, framework-version fit, dependent count — so single-star, zero-dependent packages are filtered before they reach sprint planning.
How can I help you explore Laravel packages today?