PHPackages                             tugmaks/yii2-cached-dataprovider - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. tugmaks/yii2-cached-dataprovider

ActiveYii2-extension[Caching](/categories/caching)

tugmaks/yii2-cached-dataprovider
================================

Cached data provider

0.1(8y ago)09MITPHPPHP &gt;7.1

Since Feb 12Pushed 8y agoCompare

[ Source](https://github.com/tugmaks/yii2-cached-dataprovider)[ Packagist](https://packagist.org/packages/tugmaks/yii2-cached-dataprovider)[ RSS](/packages/tugmaks-yii2-cached-dataprovider/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Yii2 DataProvider caching decorator
===================================

[](#yii2-dataprovider-caching-decorator)

Simple decorator for dataprovider

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist tugmaks/yii2-cached-dataprovider "0.1"

```

or add

```
"tugmaks/yii2-cached-dataprovider": "0.1"

```

to the require section of your `composer.json` file.

Usage example
-------------

[](#usage-example)

First, you need to configure CacheResolver service in container

```
'singletons' => [
        'cache'                               => function () {
            return \Yii::$app->cache;
        },
        'cache_resolver.naming_strategy.caching_item_name' => [
            ['class' => \Tugmaks\Dataprovider\DefaultCacheKeyNamingStrategy::class],
            [
                'caching_item_name',
            ],
        ],
        'cache_resolver.caching_item_name'                 => [
            ['class' => \Tugmaks\Dataprovider\CacheResolver::class],
            [
                Instance::of('cache'),
                Instance::of('cache_resolver.naming_strategy.caching_item_name'),
                //Additionally you can pass cache ttl and dependecy
            ],
        ],
    ],
```

Second, instead of passing yii\\data\\DataProviderInterface object directly to data widget, you have to decorate it in this way:

```
use use Tugmaks\Dataprovider\CachedDataProvider;

$cacheResolver = \Yii::$container->get('cache_resolver.caching_item_name');

$cachedDataProvider = new CachedDataProvider($dataProvider, $cacheResolver);
```

Now pass $cachedDataProvider to data widget.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3012d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c3c489ffecb0524e5825675ae8a5d14cec43b2264b750c8a04e8674f9b3ce422?d=identicon)[tugmaks](/maintainers/tugmaks)

---

Top Contributors

[![tugmaks](https://avatars.githubusercontent.com/u/3036462?v=4)](https://github.com/tugmaks "tugmaks (2 commits)")

---

Tags

yii2cached dataprovider

### Embed Badge

![Health badge](/badges/tugmaks-yii2-cached-dataprovider/health.svg)

```
[![Health](https://phpackages.com/badges/tugmaks-yii2-cached-dataprovider/health.svg)](https://phpackages.com/packages/tugmaks-yii2-cached-dataprovider)
```

###  Alternatives

[devgroup/yii2-tag-dependency-helper

Helper for unifying cache tag names with invalidation support in yii2

34507.4k7](/packages/devgroup-yii2-tag-dependency-helper)[bazilio/yii2-async

Provides translucent api for moving large tasks out of request context

6248.8k2](/packages/bazilio-yii2-async)[lajax/yii2-asset-minifier

Runtime minification and combination of asset files.

1010.4k](/packages/lajax-yii2-asset-minifier)[undefinedor/yii2-cached-active-record

The cached activeRecord for the Yii2 framework

102.6k](/packages/undefinedor-yii2-cached-active-record)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
