When I uploaded an image ( example: user/1/user_profile_img.jpg
), I want intervention image to create multiple thumbnail sizes ( 100x100
, 200x200
, 400x400
etc ), these sizes will be use in different pages to improve the pagespeed score.
Should I store the different thumbnail sizes ( 100x100
, 200x200
, 400x400
etc ) in a custom /cache/
folder? like '/cache/user/1/user_profile_img-100x100.jpg
'?
or I generate them when the page is visited with the intervention image cache resize route like:
{{ route('photos/item/100x100/userprofile/user_profile_img.jpg') }}
in the blade.php template?
Route::get('photos/item/{size}/{reference}/{photo}', 'ImgController@showImg');
I saw there is a 'lifetime (optional)
' parameter in the Intervention Image Cache function:
$img = Image::cache(function($image) {
$image->make('public/foo.jpg')->resize(300, 200)->greyscale();
}, 10, true);
The lifetime in minutes of the image callback in the cache.
Is it for setting the image cache expiry time?
Will the image be auto deleted from /cache/
folder?