PHPackages                             galancev/smart-cache - 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. galancev/smart-cache

ActiveLibrary[Caching](/categories/caching)

galancev/smart-cache
====================

Smart cache component

v2.0.1(6y ago)01.2kGPL-3.0-onlyPHPPHP &gt;=5.4.0

Since Nov 14Pushed 6y ago1 watchersCompare

[ Source](https://github.com/galancev/smart-cache)[ Packagist](https://packagist.org/packages/galancev/smart-cache)[ RSS](/packages/galancev-smart-cache/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (5)Dependencies (1)Versions (6)Used By (0)

smart-cache
===========

[](#smart-cache)

Очередной костыль для кеширования.

Usage:

```
use Components\Cache\SmartCache;

$cache = (new SmartCache())
    ->setGroup('test')
    ->setKey('supertest1')
    ->setExpire(5)
    ->get();

if ($cache->hasResult()) {
    $need = $cache->getResult();
} else {
    $need = rand(0, 666);

    $cache->set($need);
}

Dev::pre($need);
```

Ну или вариант для тех, кто не любит чейны:

```
$cache = SmartCache::factory([
    'group' => 'test',
    'key' => 'supertest1',
    'expire' => 5,
    'scatter' => 0,
])->get();
```

Ну или ещё вариант, кому нравится одним методом:

```
$cache = SmartCache::init('test', 'supertest1', 5, 0);
```

Ну или ещё один чёткий вариант через замыкание, он вообще современный офигеть какой

```
$data = (new SmartCache())
    ->setGroup('test')
    ->setKey('test')
    ->setExpire(5)
    ->remember(function () {
        $res = App::$DB->Query('SELECT * FROM b_user LIMIT 1');

        if(!$res)
            return false;

        return $res->FetchAll();
    });
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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

Every ~110 days

Total

5

Last Release

2392d ago

Major Versions

v1.1 → v2.02020-01-28

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/525800?v=4)[Evgeniy Galantsev](/maintainers/galancev)[@galancev](https://github.com/galancev)

---

Top Contributors

[![galancev](https://avatars.githubusercontent.com/u/525800?v=4)](https://github.com/galancev "galancev (17 commits)")

### Embed Badge

![Health badge](/badges/galancev-smart-cache/health.svg)

```
[![Health](https://phpackages.com/badges/galancev-smart-cache/health.svg)](https://phpackages.com/packages/galancev-smart-cache)
```

###  Alternatives

[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

21114.2k](/packages/iazaran-smart-cache)[phpfastcache/phpssdb

PHP SSDB Driver for phpFastCache

14736.9k1](/packages/phpfastcache-phpssdb)[rapidwebltd/rw-file-cache

RW File Cache is a PHP File-based Caching Library. Its syntax is designed to closely resemble the PHP memcache extension.

15196.8k7](/packages/rapidwebltd-rw-file-cache)[yuzuru-s/redis-recommend

Wrapping Redis's sorted set APIs for specializing recommending operations.

392.9k](/packages/yuzuru-s-redis-recommend)

PHPackages © 2026

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