yii2缓存

use yiicachingCache;
$cache Yii::$app->cache;
$cache['var1'] = $value1;  // equivalent to: $cache->set('var1', $value1);
$value2 $cache['var2'];  // equivalent to: $value2 = $cache->get('var2');
原文地址:https://www.cnblogs.com/pcx105/p/6795693.html