Help Có cách nào sử dụng 2 cache cùng một lúc không ạ

ENXF NET

Corporal
Em muốn sử dụng redis cache và memcached cùng trên 1 site thì có được không và cách thực hiện ạ
Mã:
// START Redis configuration //
$config['cache']['enabled'] = true;
$config['cache']['sessions'] = true;
$config['cache']['namespace'] = 'xfredis_';

$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config'] = array(
'server' => '127.0.0.1',
'port' => 6379,
'connect_retries' => 2,
'use_lua' => true,
'compress_data' => 2,
'read_timeout' => 1,
'timeout' => 1,
'serializer' => 'igbinary',
);
// END Redis configuration //
$config['cache']['enabled'] = true;
$config['pageCache']['lifetime'] = 300;
$config['cache']['sessions'] = true;
$config['cache']['provider'] = 'Memcached';
$config['cache']['config'] = ['servers' => [['localhost', 11211]]];

$config['pageCache']['enabled'] = true;
$config['cache']['context']['page']['provider'] = 'Memcached';
$config['cache']['context']['page']['config'] = ['servers' => [['localhost', 11211]]];
Em thêm code này trong config thì chỉ chạy memcache, cảm ơn mn
 
$config['cache']['enabled'];

$config['pageCache']['enabled'];
mỗi cái ông cho nó chạy 1 cache riêng là được mà.

Mã:
$config['cache']['enabled'] = true;
$config['cache']['sessions'] = true;
$config['cache']['provider'] = 'Redis';
$config['cache']['config'] = [
    ***,
    ***
];


$config['pageCache']['enabled'] = true;
$config['cache']['context']['page']['provider'] = 'Memcached';
$config['cache']['context']['page']['config'] = ['servers' => [['localhost', 11211]]];
 
mà cái
$config['pageCache']['enabled']
khi bật nó, user singin xong singout nó sẽ bị dính lỗi bảo mật thì phải...
Và phải đợi 1 lút sau cachche reset hoặc hard refresh page mới singin trở vào được... rofl~~
 
mà cái
$config['pageCache']['enabled']
khi bật nó, user singin xong singout nó sẽ bị dính lỗi bảo mật thì phải...
Và phải đợi 1 lút sau cachche reset hoặc hard refresh page mới singin trở vào được... rofl~~
Ừm bác chơi cả 2 có vẻ k được rồi, em chuyển qua Litespeed cache vậy
 
pagecache nếu config chuẩn thì không bị lỗi gì cả. Tuy nhiên nếu dùng cloudflare thì pagecache sẽ lỗi và không có tác dụng. Muốn pagecache với cloudflare thì 200$ mỗi tháng.
 
Back
Top