Pthumb / phpthumb cache clearing not working

I am using pthumb 2.3.3 on MODX 2.8.7 with the following system settings:

phpthumb_cache_maxage: 30
phpthumb_cache_maxfiles: 1000
phpthumb_cache_maxsize: 500
pthumb.clean_level: 1

According to the docs I would expect pthumb to cleanup generated thumbnails under image-cache folder if they are either older than 30 days, more than 1000 files or the cache directory is larger than 500 MB in size. However, none of this is working. My cache folder is now 8GB in size and more than 60k images.

What am I doing wrong? Am I missing a certain configuration here?

When you (temporarily) change the system setting log_level to 3 (= INFO) and then run “Manage” → “Clear Cache”, you should see output from the pThumb-cache-clearer in the Console-window (that is displayed).
The output looks something like this:

[pThumb Cache Manager] Clean Level: 1 || Max Age: 30 days || Max Size: 100 MB || Max Files: 10000
:: Remote Images Cache: 0 images (0 MB)
:: Purged 0 images
:: phpThumbOf Cache: 2 images (0.03 MB)
:: Purged 0 images

Are the settings (shown in the first line) correct?


What file extension do the cached image files have?
(I think there could be an issue if it’s not jpg, jpeg, png or gif.)

Ty for the reply. I was able to debug it. Turns out everything is working as expected. Source of error was that my MODX cache was never cleared for several days and due to the heavy usage of external images with cache busting the disk space was quickly filled up by the image cache. When I was checking it the space was already too little to run the clear up plugin correctly and therefore it failed. I implemented a cron job to that programmatically cleans up the thumbnails folder for remote images every 24 hrs.

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.