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

ActiveLibrary[Caching](/categories/caching)

phpsoftbox/cache
================

Cache component (PSR-6/PSR-16) for the PhpSoftBox framework

0106↓86.7%PHP

Since Jul 1Pushed 1mo agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

PhpSoftBox Cache
================

[](#phpsoftbox-cache)

About
-----

[](#about)

`phpsoftbox/cache` — компонент кеширования для PhpSoftBox.

Ключевые свойства:

- основной сервис для DI: `PhpSoftBox\Cache\Cache`
- несколько сторов (stores) по имени: `default`, `files`, `redis` и т.д.
- расширяемые драйверы через `DriverFactoryInterface`
- поддержка PSR-16 и PSR-6

Установка и требования
----------------------

[](#установка-и-требования)

- PHP **^8.4** (см. `composer.json`)
- Установите пакет: `composer require phpsoftbox/cache`
- Опциональные расширения/сервисы для драйверов: `ext-redis`, `ext-memcached`, `ext-pdo` (доступ к БД для PDO).

Quick Start
-----------

[](#quick-start)

### Без DI

[](#без-di)

```
use PhpSoftBox\Cache\Configurator\CacheBuilder;

$config = [
    'default' => 'default',
    'stores' => [
        'default' => [
            'driver' => 'array',
            'namespace' => 'app',
            'default_ttl' => 60,
        ],
    ],
];

$cache = CacheBuilder::fromConfig($config);

$cache->store()->set('foo', 'bar', 30);
```

### Через DI

[](#через-di)

См. пример для PHP-DI в документации: [docs/04-di.md](docs/04-di.md).

CLI
---

[](#cli)

Пакет регистрирует команду `cache:prune`, если приложение использует `phpsoftbox/cli-app` и package command discovery:

```
php psb cache:prune
php psb cache:prune --store=default --tmp-max-age-hours=24 --max-age-days=30
```

Команда удаляет expired-записи, битые cache-файлы и старые временные файлы. Permanent-записи без TTL удаляются только при явном `--max-age-days`.

Оглавление
----------

[](#оглавление)

- [Документация](docs/index.md)
- [About](docs/01-about.md)
- [Quick Start](docs/02-quick-start.md)
- [Конфигурация](docs/03-configuration.md)
- [DI](docs/04-di.md)
- [PSR-16/PSR-6](docs/05-psr.md)

###  Health Score

23

—

LowBetter than 25% of packages

Maintenance60

Regular maintenance activity

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0279d150240c97d210034878b0467462246dc14d29b5618157ff6a8be49a50e3?d=identicon)[inspector-who](/maintainers/inspector-who)

---

Top Contributors

[![inspector-who](https://avatars.githubusercontent.com/u/6973963?v=4)](https://github.com/inspector-who "inspector-who (1 commits)")

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/phpsoftbox-cache/health.svg)](https://phpackages.com/packages/phpsoftbox-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)[ichhabrecht/intcache

Turn uncachable page objects into cacheable links

193.9k](/packages/ichhabrecht-intcache)

PHPackages © 2026

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