One lesson from building the proxy: Storage::download() and streamDownload() buf...

@danielpetrica@infosec.exchange

One lesson from building the proxy: Storage::download() and streamDownload() buffer the entire file into memory. That gets expensive with large images. Switching to readStream() + response()->stream() sends the file directly from S3 to the client, no buffering. Small detail, big impact when you are serving media at scale.

#Laravel #PHP #programming

danielpetrica.com/how-to-repla