thinkphp-cache
说明
可以用于select
、find
、value
和column
方法,以及其衍生方法,使用cache
方法后,在缓存有效期之内不会再次进行数据库查询操作,而是直接获取缓存中的数据
示例
Db::table('think_user')->where('id=5')->cache(true)->find();
指定缓存时间
Db::table('think_user')->cache(true,60)->find();//或者使用下面的方式是等效的Db::table('think_user')->cache(60)->find();
指定缓存标识
Db::table('think_user')->cache('key',60)->find();
调用缓存标识
$data=\think\Cache::get('key');
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。