Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

URL manipulated images not updating when original file changes #25

Closed
enzomglb opened this issue Sep 6, 2014 · 5 comments
Closed

URL manipulated images not updating when original file changes #25

enzomglb opened this issue Sep 6, 2014 · 5 comments

Comments

@enzomglb
Copy link

enzomglb commented Sep 6, 2014

Hello, it seems that URL manipulated images don't get updated when we make changes to the original file. Eg:

I call imagecache/135x135/images/test.jpg and I get a nice 135x135 thumbnail from my custom template.

But if I modify the original image...
Image::make('images/test.jpg')->greyscale()->save();

... and the hit again imagecache/135x135/images/test.jpg I'm going to get the exact same thumbnail as the beginning since it's going to load the cached version of the thumbnail, ignoring the changes on the original image.

Maybe it shouldn't load the cached version when its modification time is older than the original's file one.

Thanks for your time and effort with this package!

@olivervogel
Copy link
Member

At the Moment this is normal behaviour. Cache must be cleared no keep up with changed originals.

Comparing the modification times Sounds like an interesting idea. Maybe there is a fast way to do that.

@enzomglb
Copy link
Author

enzomglb commented Sep 6, 2014

That'd be great, I don't think it could affect performance that much running something like filemtime()...
In the meantime, What do you suggest as a temporary solution? I can't see how I can handle cleaning the cache for that particular file since the URL Manipulation function only lets us define templates... Any idea?

@olivervogel
Copy link
Member

I'm afraid there is no quick solution. Intervention Image uses illuminate/cache to store cached images. And as far as I know there is no way to get the age of any particular data in cache, which might be configured to store data not only in filesystem but also Memcached, Redis or any other implementation.

@olivervogel
Copy link
Member

Added in 8e9df76.

@guilhermeaiolfi
Copy link

The old cached image file will live forever in the filesystem? It seems that way. Shouldn't it remove the old ones when the new is generated?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants