A multi-level cache component for Yii2

Fund package maintenance!

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0


v0.1.0 2020-06-05 05:17 UTC

This package is auto-updated.

Last update: 2023-05-10 01:23:17 UTC


Multilevel cache is a Yii2 cache component to support multi-level caching.

Configure a fast, local cache component like ArrayCache as the level1 cache, and configure a slower cache component like FileCache as the level2 cache. The multilevel cache component will automatically check the level1 cache first and only check level2 and populate level1 with the result when level1 misses.


The preferred way to install this extension is through composer.

php composer.phar require --prefer-dist thamtech/yii2-multilevel-cache

or add

"thamtech/yii2-multilevel-cache": "*"

to the require section of your composer.json file.


Application configuration example:

'components' => [
    'cache' => [
        'class' => 'thamtech\caching\multilevel\BiLevelCache',
        'level1' => [
            'class' => 'yii\caching\ArrayCache',
            'serializer' => false,
        'level2' => [
            'class' => 'yii\caching\FileCache',

See Also