Add section about streaming reads with the s3 driver #9173
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is the spiritual successor to #8371.
The
s3
filesystem driver doesn't really stream reads by default, even when calling e.g.readStream
. Instead, it copies the whole file to a temporary directory and then returns a stream to that temporary file. This is because streaming reads are disabled by default:https://github.com/laravel/framework/blob/v10.34.2/src/Illuminate/Filesystem/FilesystemManager.php#L244
This was introduced in laravel/framework#34001, but without an explicit reason. I also asked about this behavior here, but without luck: laravel/framework#49232.
I suspect that it was disabled by default because Flysystem changed the default behavior to using streams, and that could've broken backwards compatibility in Laravel 7.x, and it was never touched since then.