• Resolved Harry Milatz

    (@harry-milatz)


    Hello,
    i am using this plugin nearly a year
    my folder with the scripts (wp-content/cache/scripts/) has a size of ~300MB after 6 month and i have to delete the files manually via ftp.
    Is it possible to clear the cache in the backend?
    The checkbox “Enable plugin” for example and then save and the message “Options have been saved! Cache cleared.” and then enable the plugin with this checkbox again, does not take any effect to the folder.

    Hope you can help me;)
    best regards,
    Harry

    https://ww.wp.xz.cn/plugins/js-css-script-optimizer/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Harry Milatz

    (@harry-milatz)

    Hello,

    i have written my own classes to clear the cache.

    ruddyred

    (@ruddyred)

    Please share

    Thread Starter Harry Milatz

    (@harry-milatz)

    Hi ruddyred,

    i don’t use this plugin anymore because i don’t work correctly with WP 4.2.x
    So i don’t have the class anymore.
    You should use Autoptimize https://ww.wp.xz.cn/plugins/autoptimize/

    But you can write something like this in your wp-cron.php:

    $localcache = '/var/www/virtual/path to the cache/';
    if (is_dir($localcache)) {
    	if ($dh = opendir($localcache)) {
    		while (($file = readdir($dh)) !== false) {
    			if ($file!="." AND $file !="..") {
    			unlink("$localcache$file");
    			}
    		}
    		closedir($dh);
    	}
    }

    ruddyred

    (@ruddyred)

    thank you

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘clearing cache’ is closed to new replies.