Title: clearing cache
Last modified: August 22, 2016

---

# clearing cache

 *  Resolved [Harry Milatz](https://wordpress.org/support/users/harry-milatz/)
 * (@harry-milatz)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/clearing-cache-4/)
 * 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://wordpress.org/plugins/js-css-script-optimizer/](https://wordpress.org/plugins/js-css-script-optimizer/)

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

 *  Thread Starter [Harry Milatz](https://wordpress.org/support/users/harry-milatz/)
 * (@harry-milatz)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/clearing-cache-4/#post-5464011)
 * Hello,
 * i have written my own classes to clear the cache.
 *  [ruddyred](https://wordpress.org/support/users/ruddyred/)
 * (@ruddyred)
 * [11 years ago](https://wordpress.org/support/topic/clearing-cache-4/#post-5464014)
 * Please share
 *  Thread Starter [Harry Milatz](https://wordpress.org/support/users/harry-milatz/)
 * (@harry-milatz)
 * [11 years ago](https://wordpress.org/support/topic/clearing-cache-4/#post-5464015)
 * 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://wordpress.org/plugins/autoptimize/](https://wordpress.org/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](https://wordpress.org/support/users/ruddyred/)
 * (@ruddyred)
 * [11 years ago](https://wordpress.org/support/topic/clearing-cache-4/#post-5464016)
 * thank you

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

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

 * ![](https://s.w.org/plugins/geopattern-icon/js-css-script-optimizer_cdb920.svg)
 * [JS & CSS Script Optimizer](https://wordpress.org/plugins/js-css-script-optimizer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/js-css-script-optimizer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/js-css-script-optimizer/)
 * [Active Topics](https://wordpress.org/support/plugin/js-css-script-optimizer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/js-css-script-optimizer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/js-css-script-optimizer/reviews/)

## Tags

 * [cache](https://wordpress.org/support/topic-tag/cache/)

 * 4 replies
 * 2 participants
 * Last reply from: [ruddyred](https://wordpress.org/support/users/ruddyred/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/clearing-cache-4/#post-5464016)
 * Status: resolved