说明
语法
Cache::delay(string $key,integer $expire = 0); //默认为0,等于永久缓存
示例代码
<?phprequire '../vendor/autoload.php';use renpengpeng\Cache;Cache::connect(['type' => 'File','file' => ['cache_dir' => realpath(__DIR__).DIRECTORY_SEPARATOR.'cache']]);// 我是一个10秒后就会到期的缓存Cache::set('cache',100);// 向后再原来的过期时间上延长1分钟Cache::delay('cache',60);// 现在将它转变为永久缓存Cache::delay('cache');
参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| key | string | 缓存键 |
| expire | int | 延长缓存时间,默认0为永久缓存 |
