@leandroprz Did you try to purge the cache from WP-Optimize > Cache?
Thread Starter
Leandro
(@leandroprz)
Yes, I purged everything but minified files are not getting deleted.
Hi @leandroprz
In order to purge everything, you can go to Minify > Advanced and turn on “Enable debug mode”.
Then in Minify status, you’ll have a “Delete all the files generated by minify”.
This should purge everything.
Note that these files get purged automatically after 30 days (which is why the button is not always visible).
Marc.
Thread Starter
Leandro
(@leandroprz)
Thanks, that did the trick.
Is there a way to change 30 days to something like 15 or 7?
Can I have issues if have debug mode enabled all the time in case I can’t change the 30 days limit?
I just want to avoid using so much disk space, I’m on a shared hosting.
@leandroprz Sorry changing the number of days is not a feature yet, by default its set to 30 days.
However you can manually delete the cache files from FTP/SFTP inside wp-content/cache folder.
@leandroprz You can use the following snippet, please add it to your active theme’s functions.php file to change the lifespan upto 7 days.
add_filter( 'wp_optimize_minify_cache_expiry_time', function( $original_value ) {
return time() - 86400 * 7;
} );
Thread Starter
Leandro
(@leandroprz)
That’s awesome. Thank you so much for the snippet!
Thread Starter
Leandro
(@leandroprz)
Hi,
I’ve been testing the snippet but it seems is not working properly. After using 7 days for a few weeks I noticed the cache wasn’t getting deleted, so I changed it to just 3 days for testing purposes.
The cache just doesn’t get deleted and keeps adding up and eating my disk resources.
@leandroprz
Please try adding the following snippet to your active themes functions.php
add_filter( ‘wp_optimize_minify_cache_expiry_time’, function( $original_value ) {
return time() – 86400 * 7;
} );