Home>

Add in yii's configuration file:

"cache" =>[
  "class" =>"yii \ caching \ apccache",],

Use of cache:

<?php
$key="cachekey";
//Read cache
$data=yii ::$app->cache->get ($key);
//Determine if the cache exists,Generate cache if not saved
if ($data === false) {
$cache->set ($key, $data);
}
?>
php
  • Previous ES6 Babel correct installation process in JavaScript
  • Next In-depth analysis of error handling in javascript