Home > Backend Development > PHP Tutorial > thinkphp cache settings

thinkphp cache settings

WBOY
Release: 2016-08-08 09:28:05
Original
1366 people have browsed it



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.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template