@cjwebdev Could you please try to use the following snippet in your themes functions.php file and check if the minified files gets automatically deleted after 3 days?
add_filter( 'wp_optimize_minify_cache_expiry_time', function( $original_value ) {
return time() - 86400 * 3;
} );
Thanks Harshad,
Yes I will add it and let you how it goes, in 3 days time.
Thanks for your reply.
CJ
@cjwebdev Sure do let us know how it goes?
Hi,
Having the same problem, Cache is up on 84Gb at the moment.
Help
@shaneupfront Could you please try to use the following snippet in your themes functions.php file and check if the minified files gets automatically deleted after 3 days?
add_filter( 'wp_optimize_minify_cache_expiry_time', function( $original_value ) {
return time() - 86400 * 3;
} );
Hi Harshad,
That snippet has been running for a few days. But Im not convinced it is working. The error log is still filling up and the total cache has almost reached 1GB with over 4000 files.
I can’t believe the cache needs over 4000 files when its a 10 page website and I’ve set the Minify Cache Lifespan to 1 day.
Yesterday the client sent me this screenshot of Homepage taken exactly the same time as the PHP warnings below: https://dev.cjweb.com.au/white-screen.jpg
Example of the PHP warnings:
[25-May-2022 12:59:46 UTC] PHP Warning: unlink(/home/wrkr/public_html/wp-content/cache/wpo-minify/tmp/js-df7b21af.js.transient): No such file or directory in /home/wrkr/public_html/wp-content/plugins/wp-optimize/cache/file-based-page-cache-functions.php on line 905
[25-May-2022 12:59:46 UTC] PHP Warning: unlink(/home/wrkr/public_html/wp-content/cache/wpo-minify/tmp/js-d6f11b19.js.transient): No such file or directory in /home/wrkr/public_html/wp-content/plugins/wp-optimize/cache/file-based-page-cache-functions.php on line 905
[25-May-2022 12:59:46 UTC] PHP Warning: unlink(/home/wrkr/public_html/wp-content/cache/wpo-minify/tmp/js-3d7822d6.js.transient): No such file or directory in /home/wrkr/public_html/wp-content/plugins/wp-optimize/cache/file-based-page-cache-functions.php on line 905
I would like to understand what the problem is and why the plugin now requires an additional code snippet? Is it a conflict with WP6.0? PHP7.4+? This is just a standard cPanel environment.
Im concerned about all my other websites running WP-Optimize. It seems like a lot of people are reporting this problem recently and trotting out a PHP snippet – with no explanation – isn’t really a proper solution.
Happy to provide any help you need.
CJ
-
This reply was modified 4 years ago by
cjwebdev.
@cjwebdev Sometimes the cron to delete the minifued files doesn’t work due to plugin conflict with their cron, so I shared with you the code snippet.
If the snippet doesn’t work then you’ll have to manually delete the cache files from WP-Optimize > Cache and WP-Optimize > Minify.
OK understood. I’ll see if anything is conflicting with the CRON schedule.
Many thanks,
CJ