Support » Plugin: WP-Optimize - Clean, Compress, Cache. » Old minify cache doesn’t get deleted

  • Resolved Leandro

    (@leandroprz)


    I just noticed my website was starting to consume a lot of disk space and realized it was the old minify cache files. Even if I reset the minified files, the “Total cache” number keeps getting bigger: https://i.imgur.com/ia41bJ6.png

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Harshad

    (@bornforphp)

    @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.

    Plugin Support Marc Lacroix

    (@marcusig)

    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.

    Plugin Support Harshad

    (@bornforphp)

    @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.

    Plugin Support Harshad

    (@bornforphp)

    @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;
    } );

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.