Clear Cache not clearing image files in /files/cache directory
Permalink
In some of the websites I am working on, in the /files/cache directory, there are files and directories like these:
- /pages (directory)
- 2ca2a8118779c299a1d85f5dd6c6dbfa.jpg (large number of image files like these)
- zend_cache---a585562d2598e0ce2add1afe2b37cb67da34707df9f15ff2b70e33d4caf3c522 (few of these)
- zend_cache---internal-metadatas---a785562d2598e0ce2add1afe2b37cb67da34707df9f15ff2b50e33d4caf3c921 (few of these)
When I Clear Cache from the Dashboard, everything else clears up from /files/cache directory except for the image files. That's around 40-50M of data there that would not clear. I thought Clear Cache is supposed to clear the entire content of /files/cache.
Most of these websites are running 5.6.2.1.
- /pages (directory)
- 2ca2a8118779c299a1d85f5dd6c6dbfa.jpg (large number of image files like these)
- zend_cache---a585562d2598e0ce2add1afe2b37cb67da34707df9f15ff2b70e33d4caf3c522 (few of these)
- zend_cache---internal-metadatas---a785562d2598e0ce2add1afe2b37cb67da34707df9f15ff2b50e33d4caf3c921 (few of these)
When I Clear Cache from the Dashboard, everything else clears up from /files/cache directory except for the image files. That's around 40-50M of data there that would not clear. I thought Clear Cache is supposed to clear the entire content of /files/cache.
Most of these websites are running 5.6.2.1.
Thanks for your reply.
Yes if I have a lot of images in the site that have been resized, then they will all have to be recreated after clearing the cache.
What if I want to clear only the images that are no longer used by any of the pages? Is there a better way to do this?
Yes if I have a lot of images in the site that have been resized, then they will all have to be recreated after clearing the cache.
What if I want to clear only the images that are no longer used by any of the pages? Is there a better way to do this?
If you want to clear everything,
http://www.concrete5.org/marketplace/addons/cache-vac/...
But it isn't clever enough to look for images in use and leave them in place.
http://www.concrete5.org/marketplace/addons/cache-vac/...
But it isn't clever enough to look for images in use and leave them in place.
Just tried your add-on. I have a few questions about different CACHE_VAC_METHOD options.
What is the difference between 'stomp' and 'all'?
'expired entries' - Is it taken from Full Page Caching in Cache & Speed Settings and only works when Full Page Caching is on?
What is the difference between 'stomp' and 'all'?
'expired entries' - Is it taken from Full Page Caching in Cache & Speed Settings and only works when Full Page Caching is on?
Stomp and All are the same thing. No difference.
Expired entries - yes, as you surmise.
Expired entries - yes, as you surmise.
A quick look at the code shows that it clears:
- The CSS cache
- Any page caches
- Block caches
- Overrides caches
and I think anywhere else output or code caching is used.
If you want to clean out those files you need to do it manually.
They're not cleaned out as I think it's perhaps something you'd only want to do if you are playing around with compression settings or something more technical. Otherwise every time you want to clear the cache to help refresh a bit of content, you'll be doing large numbers of delete, requiring a site to re-size hundreds/thousands of images.
-Ryan