использую такой вариант
set_time_limit(0);
/** @var \League\Flysystem\Filesystem $fs */
$fs = Storage::disk('files')->getDriver();
$metaData = $fs->getMetadata($file->fullroute);
$stream = $fs->readStream($file->fullroute);
if (ob_get_level()) ob_end_clean();
return response()->stream(
function () use ($stream) {
fpassthru($stream);
},
200,
[
'Cache-Control' => 'private',
'Content-Type' => $file->type,
'Content-Length' => $file->size,
'Content-Disposition' => 'attachment; filename="' . $file->filename . '"',
'Pragma' => 'public',
]);
Как можно ограничить скорость отдачи?