This patch automatically deletes cached images from all presets when the original image no longer exists. This is done scanning each preset and looking for the original image. If it does not exist the cached image is deleted. A new configuration option is added to configure how often to do that.
Without this patch cached images are only deleted manually flushing each preset, which is cumbersone and can overflow busy sites if you forget to do that frequently. Besides that the flush deletes all images, even the ones that still are being used what makes the server rebuild the image.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | imagecache.patch | 3.44 KB | apcal |
| imagecache.patch | 2.73 KB | apcal |
Comments
Comment #1
apcal commentedComment #2
dopry commentedcan you provide a unified diff...
see: http://www.drupal.org/patch/create
Comment #3
LeisureLarry commentedSubscribe
Comment #4
checker commentedare there any experiences with imagecache.patch ?
Comment #5
apcal commentedunified diff attached, as requested
Comment #6
dopry commentedI'd appreciate reviews... I'm working on new 2.x development atm.
Comment #7
tj2653 commentedsubscribing
Comment #8
dopry commentedlooking at it _scan_directory should be prefixed with _imagecache to prevent namespace conflicts... Can I get functional reviews from anyone?
Comment #9
dopry commentedI think this will probably go into imagecache 2.1.... I like the feature... The scan directory should be broken up so it does small chunks at a time... cron will time out otherwiser and we'll never get through the whole dir on large sites... I would also like to merge this with corrupt image detection..
http://drupal.org/node/233691#comment-813844
Comment #10
danny_joris commentedThis would be great.
The original images get deleted when the node is deleted, but the imagecache files will remain until a manual flush is done. I really like the idea of this being automated. Would this work using cron? I like the idea of clean file folders...
The last comment is exactly 2 years old. What is the status on this? I would love to use this functionality! :)
Cheers,
Danny
Comment #11
fizk commentedPlease reopen if this is still an issue with ImageCache 6.x-2.0-rc1.