Install Laravel CachedAdapter
Do run the command below from your terminal.
composer require league/flysystem-cached-adapter "~1.0"
Enable the Cache Driver
And now to enable the cache driver you can specify the 'cache' key and specify the cache details. From the example docs it's using the "Memcached" store and it's set to 600 seconds to expire and has a prefix of "cache-prefix"
's3' => [ 'driver' => 's3', // Other Disk Options... 'cache' => [ 'store' => 'memcached', 'expire' => 600, // 10 mins 'prefix' => 'cache-prefix', ], ],
's3' => [ 'driver' => 's3', 'key' => env('AWS_ACCESS_KEY_ID'), 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'region' => env('AWS_DEFAULT_REGION'), 'bucket' => env('AWS_BUCKET'), 'url' => env('AWS_URL'), 'endpoint' => env('AWS_ENDPOINT'), 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), 'cache' => [ 'store' => 'redis', 'expire' => 3600, // 1 hour 'prefix' => 's3-cache', ], ],
Leave a reply