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

ActiveLibrary[Caching](/categories/caching)

graphstory/cache-interface
==========================

Generic cache interfaces

0.0.3(10y ago)118MITPHPPHP &gt;=5.4

Since Aug 26Pushed 10y ago5 watchersCompare

[ Source](https://github.com/GraphStory/cache-interface)[ Packagist](https://packagist.org/packages/graphstory/cache-interface)[ RSS](/packages/graphstory-cache-interface/feed)WikiDiscussions develop Synced 2mo ago

READMEChangelog (3)Dependencies (4)Versions (5)Used By (0)

Graph Story Cache Interface
===========================

[](#graph-story-cache-interface)

Simple cache adapters and interface based on Anthony Ferrara's blog post [A Followup To An Open Letter To PHP-FIG](http://blog.ircmaxell.com/2014/10/a-followup-to-open-letter-to-php-fig.html).

[![Build Status](https://camo.githubusercontent.com/848148f48c2befb71064ff55c8881133c3b3a21a069e956fdbc1e1e196706d18/68747470733a2f2f7472617669732d63692e6f72672f477261706853746f72792f63616368652d696e746572666163652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/GraphStory/cache-interface)

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

[](#installation)

### Using Composer

[](#using-composer)

Use [Composer](https://getcomposer.org/) to install the cache-interface library:

`$ composer require graphstory/cache-interface`

Usage
-----

[](#usage)

```
// Example using Daniel González's Cache library

use Desarrolla2\Cache\Cache;
use Desarrolla2\Cache\Adapter\File;
use GraphStory\Console\Cache\DesarrollaAdapter;

$cacheDir = '/tmp';
$adapter = new File($cacheDir);
$adapter->setOption('ttl', 3600);
$desarrolla2 = new Cache($adapter);
$cache = DesarrollaAdapter($desarrolla2);

$cache->set('key', 'myKeyValue', 3600);

// later ...

echo $cache->get('key');
```

(The above example was mostly cribbed from the [desarrolla2/Cache](https://github.com/desarrolla2/Cache) documentation.)

BYOA (bring your own adapter)
-----------------------------

[](#byoa-bring-your-own-adapter)

You can write your own adapter by creating a class that implements the `CacheAdapter` interface. Use the other adapters as a reference and you should be good to go!

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

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

Every ~43 days

Total

3

Last Release

3829d ago

### Community

Maintainers

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

---

Top Contributors

[![jeremykendall](https://avatars.githubusercontent.com/u/288613?v=4)](https://github.com/jeremykendall "jeremykendall (29 commits)")

---

Tags

interfacecacheadapter

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[psr/simple-cache

Common interfaces for simple caching

8.1k727.3M2.1k](/packages/psr-simple-cache)[psr/cache

Common interface for caching libraries

5.2k686.9M1.3k](/packages/psr-cache)[amnuts/opcache-gui

A clean, effective and responsive interface for Zend OPcache, with real(ish)-time monitoring, filtering and the ability to invalidate files

1.3k4.6M14](/packages/amnuts-opcache-gui)[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)[madewithlove/illuminate-psr-cache-bridge

861.5M13](/packages/madewithlove-illuminate-psr-cache-bridge)[beste/in-memory-cache

A PSR-6 In-Memory cache that can be used as a fallback implementation and/or in tests.

2512.2M6](/packages/beste-in-memory-cache)

PHPackages © 2026

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