Reputation: 105
Yii2 documentation suggests the following configuration which is applicable for memCache.
'components' => [
'cache' => [
'class' => 'yii\caching\MemCache',
'servers' => [
[
'host' => 'server1',
'port' => 11211,
'weight' => 100,
],
],
],
]
Thanks
Upvotes: 2
Views: 1055
Reputation: 25312
The goal of Opcache is not to store data, you cannot use it as a Yii2 data caching component :
OPcache improves PHP performance by storing precompiled script bytecode in shared memory, thereby removing the need for PHP to load and parse scripts on each request.
You should read this : Supported Cache Storage in Yii2.
Upvotes: 2