cacheAlways
的使用方法与cache
一样,只不过在最终表现中,如果本次查询数据为空,那么cache
不会缓存,而cacheAlways
会把这次空数据
缓存下来,下次查询的时候会直接返回空数据
.
Db::table('user')->cacheAlways('key',60,'tagName')->where('username','think')->find();
// 与下面的cache方式效果相同
Db::table('user')->cache('key',60,'tagName',true)->where('username','think')->find();