使用redis存储缓存(包括session)
解决session lock堵塞问题
This commit is contained in:
parent
1727f34516
commit
ce049b9c96
@ -34,7 +34,9 @@
|
||||
"gemorroj/archive7z": "^5.7",
|
||||
"npm-asset/viewerjs": "^1.11",
|
||||
"npm-asset/plyr": "^3.7",
|
||||
"ext-fileinfo": "*"
|
||||
"ext-fileinfo": "*",
|
||||
"npm-asset/ace-builds": "^1.32",
|
||||
"yiisoft/yii2-redis": "^2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"yiisoft/yii2-debug": "~2.1.0",
|
||||
|
@ -18,8 +18,11 @@ $config = [
|
||||
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
|
||||
'cookieValidationKey' => '9vuTNyfQqTOWY8fhAajrAhOfX_uaZqZZ',
|
||||
],
|
||||
// 'cache' => [
|
||||
// 'class' => 'yii\caching\FileCache',
|
||||
// ],
|
||||
'cache' => [
|
||||
'class' => 'yii\caching\FileCache',
|
||||
'class' => 'yii\redis\Cache',
|
||||
],
|
||||
'user' => [
|
||||
'identityClass' => 'app\models\User',
|
||||
@ -44,6 +47,15 @@ $config = [
|
||||
],
|
||||
],
|
||||
],
|
||||
'session' => [
|
||||
'class' => 'yii\redis\Session',
|
||||
],
|
||||
'redis' => [
|
||||
'class' => 'yii\redis\Connection',
|
||||
'hostname' => 'localhost',
|
||||
'port' => 6379,
|
||||
'database' => 0,
|
||||
],
|
||||
'db' => $db,
|
||||
/*
|
||||
'urlManager' => [
|
||||
|
Loading…
x
Reference in New Issue
Block a user