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

ActiveLibrary[Caching](/categories/caching)

koded/cache-extended
====================

A PSR-6 caching library with support for several caching technologies.

2.0.0(5y ago)041BSD-3-ClausePHPPHP ^8CI failing

Since Nov 2Pushed 5y ago1 watchersCompare

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

READMEChangelog (6)Dependencies (7)Versions (7)Used By (0)

Koded - Extended Caching Library
================================

[](#koded---extended-caching-library)

[![Latest Stable Version](https://camo.githubusercontent.com/d1aad05404ec641a013d8fedaa7577bc4016af26dcec998a70f9a23b77fc7de3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b6f6465642f63616368652d657874656e6465642e737667)](https://packagist.org/packages/koded/cache-extended)[![Build Status](https://camo.githubusercontent.com/a4077cd8fd9ab581f847850ca148ed8bef96df09b044336cb7f64f992d3512f0/68747470733a2f2f7472617669732d63692e6f72672f6b6f6465647068702f63616368652d657874656e6465642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/kodedphp/cache-extended)[![Code Coverage](https://camo.githubusercontent.com/b8f2d129abca0cbfbe0f5643febc29271fad9dcacbb9ba2a45bf7732202d126d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b6f6465647068702f63616368652d657874656e6465642f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/kodedphp/cache-extended/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/c845aeb379f2b164cb0bf6096ee304d6eaefa810c106a1e5a969db4128c81a15/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b6f6465647068702f63616368652d657874656e6465642f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/kodedphp/cache-extended/?branch=master)[![Minimum PHP Version](https://camo.githubusercontent.com/905c670b6e3bc20026bddbc8923df4d38111e526b88f1252ac4ceb6643299d96/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e302d3838393242462e737667)](https://php.net/)[![Software license](https://camo.githubusercontent.com/b3775a2de17853a90995faa104f941eef3ad3c40cc89e34b8b1eaea014614d4e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d425344253230332d2d436c617573652d626c75652e737667)](LICENSE)

A [PSR-6](http://www.php-fig.org/psr/psr-6/) caching library for PHP 7 using several caching technologies.

Requirements
------------

[](#requirements)

- Linux machine
- PHP 8

Recommended cache technologies are

- Redis server
- Memcached

Recommended PHP modules

- [Redis extension](https://github.com/phpredis/phpredis/blob/develop/INSTALL.markdown)
- [Memcached extension](https://github.com/php-memcached-dev/php-memcached)

For developing purposes you can use

- Memory client (default)
- File client

Usage
-----

[](#usage)

- create an instance of `CacheItemPoolInterface` with desired caching technology
- manipulate the cache items with the pool instance

```
$cache = CachePool::use('redis');

$item = $cache->getItem('fubar');
$item->set('some value');
$item->expiresAfter(new DateTime('3 days'));

$cache->save();
```

**The pool instance is created only once.**

> `CachePool::use()` accepts specific parameters for the underlying caching technology.
> This method uses the [Koded Simple Cache](https://github.com/kodedphp/cache-simple#configuration-directives) package. Please see the README in that repository for the specific arguments.

You can grab the cache client if you want to use it directly

```
/** $var Koded\Caching\Cache $client */
$client = $cache->client();
```

Deferring the items
-------------------

[](#deferring-the-items)

To postpone the saving of the cache items (store all items "at once"), you can use the `saveDeferred()` method. These cache items are saved when you

- execute `commit()`
- when `CacheItemPoolInterface` instance is destroyed

**Keep in mind that `commit()` is not an atomic operation.**There is no guarantee that all items will be saved, because anything can happen while `save()` runs (network, client crash, etc).

```
$cache->saveDeferred($event);
$cache->saveDeferred($counter);

// ... do some stuff

// store this now
$cache->save($dependency);

// ... do more stuff

$cache->saveDeferred($updates);
$cache->saveDeferred($extras);

// Store all deferred items
$cache->commit();
```

License
-------

[](#license)

The code is distributed under the terms of [The 3-Clause BSD license](LICENSE).

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity65

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 ~182 days

Total

6

Last Release

1836d ago

Major Versions

1.2.2 → 2.0.02021-05-03

PHP version history (4 changes)1.0.0PHP ^7.1.4

1.1.0PHP ^7.3

1.2.0PHP ^7.2

2.0.0PHP ^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/02c41fefd80a09d9f349706dbee9f45b9cfe539509881a05af4fa8d3517a878d?d=identicon)[kodeart](/maintainers/kodeart)

---

Top Contributors

[![kodeart](https://avatars.githubusercontent.com/u/202293?v=4)](https://github.com/kodeart "kodeart (36 commits)")

---

Tags

cachecachingfilecachejsonmemcachedpsr-6redisjsonrediscachecachingpsr-6memcachedfile cache

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[tedivm/stash

The place to keep your cache.

9824.8M124](/packages/tedivm-stash)[apix/cache

A thin PSR-6 cache wrapper with a generic interface to various caching backends emphasising cache taggging and indexing to Redis, Memcached, PDO/SQL, APC and other adapters.

114542.8k6](/packages/apix-cache)[matthiasmullie/scrapbook

Scrapbook is a PHP cache library, with adapters for e.g. Memcached, Redis, Couchbase, APCu, SQL and additional capabilities (e.g. transactions, stampede protection) built on top.

3212.5M32](/packages/matthiasmullie-scrapbook)[tedivm/stash-bundle

Incorporates the Stash caching library into Symfony.

841.4M16](/packages/tedivm-stash-bundle)[aplus/cache

Aplus Framework Cache Library

161.6M4](/packages/aplus-cache)

PHPackages © 2026

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