return [
'default' => [
'host' => '127.0.0.1',
'password' => null,
'port' => 6379,
'database' => 10,
],
'cache' => [
'host' => '127.0.0.1',
'password' => null,
'port' => 6379,
'database' => 0,
],
];
<?php
namespace app\controller;
use support\Request;
use support\Cache;
use support\Redis;
class TestcacheController
{
public function index(Request $request)
{
Cache::set('aaaa','cache_v');
Redis::set('aaaa',time());
}
}
3、結(jié)果被存到了同一空間中,且只有一套數(shù)據(jù),redis覆蓋了cache數(shù)據(jù)