Level 67
You can set the cache headers on responses just like your Content-Type
return response($img, 200)->withHeaders([
'Content-Type' => 'image/jpg',
'Pragma' => 'public',
'Cache-Control' => 'max-age=86400',
'Expires' => gmdate('D, d M Y H:i:s \G\M\T', time() + 86400)
]);
https://laravel.com/docs/5.6/responses#attaching-headers-to-responses
1 like