mardi 3 août 2021

Performance issue with streaming files from digial ocean storage in laravel 5.5

I am using digital ocean space for storing files. I am having performance issue while reading files from there, specially streaming files in a route. Here is my code structure.

Default Driver:

FILESYSTEM_DRIVER=digitalocean

Disk Config:

'digitalocean' => [
        'driver' => 's3',
        'key' => env('DIGITALOCEAN_SPACES_KEY'),
        'secret' => env('DIGITALOCEAN_SPACES_SECRET'),
        'endpoint' => env('DIGITALOCEAN_SPACES_ENDPOINT'),
        'region' => env('DIGITALOCEAN_SPACES_REGION'),
        'bucket' => env('DIGITALOCEAN_SPACES_BUCKET'),
    ],

Controller function:

public function view($path)
{
    return Storage::response($filePath);
}

This is really slow since it fetches file from the cloud storage and then streams in a url. Is there any way to speedup the process ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire