1

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 ?

Sagar Gautam
  • 9,049
  • 6
  • 53
  • 84
  • Did you find a solution to your issue? I am also looking for the same. – joeyj May 28 '22 at 21:20
  • @joeyj, It was really slow on local setup but have good performance with server in same region as of digital ocean. – Sagar Gautam Jun 03 '22 at 15:38
  • thanks for confirming, on my end I found a way to read in chunks which was more relevant for my use case as the files being read needed to be streamed and be flexible for the user to skip/read specific sections. – joeyj Jun 04 '22 at 15:04

0 Answers0