Skip to content

Inefficient $response->file() should be removed #210

@ePirat

Description

@ePirat

The $response->file() function should be removed or at least not be mentioned so heavily in the samples in the Readme. It is very bad practice to send files by just outputting them with php, php was not made for this and it should be preferred to redirect to the file using Location header.
It may work fine for small files, but it will make a lot of trouble for large files, especially with slow connections, since they will hit the max execution time of a php script. (This can be changed, but defaults to a very short time, about 30 seconds)

See "Why does readfile() exhaust PHP memory?" and "PHP readfile() and large downloads" and "Readfile() and large files"

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions