Skip to content

thamtech/yii2-multilevel-cache

Repository files navigation

Yii2 Multilevel Cache

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.

Installation

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.

Usage

Application configuration example:

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

See Also

About

Multilevel cache component for Yii2

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages