We use the Dream dedecms system for a long time, uninterrupted in the background to update the system cache, some cache folders and cache files are not cleaned, resulting in the accumulation of garbage cache files more and more, can be calculated by millions, Now enhance the update system cache function to clean up the cache files and folders of the sink.
Enhanced dream Dedecms The ability to "update the system cache" to clean up the sink cache
We use the Dream dedecms system for a long time, uninterrupted in the background to update the system cache, some cache folders and cache files are not cleaned, resulting in the accumulation of garbage cache files more and more, can be calculated by millions, Now enhance the update system cache function to clean up the cache files and folders of the sink.
The main increase is the ability to clean up the following cache folders:
Data\cache
Data\tplcache
Data\sessions
Operation Method:
--------------------------------------------------------------
Open background file: dede/sys_cache_up.php
Locate Checkpurview (' Sys_arcbatch ') and add the following code to the next line:
//clean up cache add -on versionfunctionClean_cachefiles ($path ){ $list=Array(); foreach(Glob($path. ‘/*‘) as $item ){ if(Is_dir($item ) ){ $list=Array_merge($list, Clean_cachefiles ($item ) ); }Else{ $list[] =$item; } } foreach($list as $tmpfile ){ @unlink($tmpfile ); } return true;}
----------------------------------------------------------------
Locate the IF ($uparc ==1) and add the following code on the previous line:
// Clean Datacacheclean_cachefiles (".. /data/cache " ); // Clean Datatplcacheclean_cachefiles (".. /data/tplcache " ); // Clean datasessionsclean_cachefiles (".. /data/sessions ");
So it can be more effective to clean up the system cache, before adding this feature, we have not found: You add ads, with the JS call, but you changed the ads, updated the cache, the ads are still unchanged, need "one-click Update"-"Update All" can be. After adding this feature, click "Update System Cache" and then refresh the page in the foreground!
Enhanced dream Dedecms The ability to "update the system cache" to clean up the sink cache