Intervention/image has a sister package imagecache. I haven't used it myself, but it does have a lifetime parameter, maybe it will help.
Caching Images
Hi everybody,
I have a question about browser caching images. When I go on the network tab of the developper tools on Chrome, I can see that some (all) of my images or returning a 304 not modified 'Status Text'.
All of these images are generated by the Intervention\Image class, and I was wondering if there was a way to add a line somewhere in order to make these images "browser caching", and return a 200 code, in order for the browser to avoid making an http request?
Or maybe it's a bad practice because it stores too much files on the client side?
Thank you very much for your tips and advices!
Oh, if your images are generated once and stored somewhere in public directory, then you should actually change your webserver's settings so it sets proper Expires headers on images (and maybe other static files), no need for any PHP code.
Please or to participate in this conversation.