Home > Article > Backend Development > thinkphp cache settings
Caching can improve the access speed, reduce the number of IO visits from the client to the server, reduce the load on the server, and plays a very important role in websites that are visited in large quantities
Example:
$Model=M('zcyceshi' );
$list=$Model->select();
$cache = cache(array('type'=>'File','expire'=>259200,'temp'=>RUNTIME_PATH.' Temp/zcyceshi/')); //Cache initialization
$cache->set('listcache',$list); //Write cache
$listcache = $cache->get('listcache'); / /Read cache
$listdel = $cache->rm('listcache'); //Delete cache
$listclear = $cache->clear('listcache'); //Clear cache
If you don’t understand You can add me at QQ:1156838184, I hope it can help everyone!
The above introduces the thinkphp cache settings, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.