Thiyaga Raj
Thiyaga Raj

Reputation: 105

How to configure Yii2 component to use op_cache?

Yii2 documentation suggests the following configuration which is applicable for memCache.

    'components' => [
    'cache' => [
        'class' => 'yii\caching\MemCache',
        'servers' => [
            [
                'host' => 'server1',
                'port' => 11211,
                'weight' => 100,
            ],

        ],
    ],
 ]
  1. How can i configure the component to use op_cache?
  2. Where can i find the 'host','port','weight' information on a local WAMP server?

Thanks

Upvotes: 2

Views: 1055

Answers (1)

soju
soju

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

Related Questions