Enhanced dream Dedecms The ability to "update the system cache" to clean up the sink cache

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.