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

ActiveLibrary[Caching](/categories/caching)

dc/cache
========

Cache interface

0.2(11y ago)0111[1 issues](https://github.com/digitalcreations/cache/issues)2MITPHP

Since May 4Pushed 9y ago2 watchersCompare

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

READMEChangelog (2)DependenciesVersions (3)Used By (2)

[![DC\Cache - Caching interface](logo.png)](logo.png)

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

[](#installation)

```
$ composer install dc/cache

```

Or add it to `composer.json`:

```
"require": {
	"dc/cache": "0.*",
}
```

```
$ composer install

```

**This package suggests `dc/cache-memcache`, which is the only implementation at this point.**

Getting started
---------------

[](#getting-started)

This is just an interface. You probably should install `dc/cache-memcahe` or write your own implementation to the interface.

When you have, you can use the interface like this:

```
$cache = new \SomeImplementation();
$cache->set('foo', 'bar');
echo $cache->get('foo'); // prints bar
```

A common pattern is that you want a specific value from the cache, and if it is a cache miss, you want to produce it:

```
echo $cache->getWithFallback('foo', function() {
  return 'bar';
}); // prints bar
$cache->get('foo'); // now also prints bar
```

This syntax works with any callable, not just closures.

You can also use the return value to determine the validity.

```
$foo = $cache->getWithFallback("foo",
    function($x) { return ["foo" => $x, "expires" => \DateInterval($x)]; },
    function($result) { return $result["expires"]; });
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity54

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

Total

2

Last Release

4221d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/592f1016d288aeb80fddba8b7749f5bf91f83305b332e8d8f37db3d19c16b7d3?d=identicon)[vegardlarsen](/maintainers/vegardlarsen)

![](https://www.gravatar.com/avatar/53f38207340517e705d87fb858772629b30fa6f1d40a65668dc5599c099d3413?d=identicon)[francisrath](/maintainers/francisrath)

---

Top Contributors

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

---

Tags

cachememcached

### Embed Badge

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

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

###  Alternatives

[tedivm/stash

The place to keep your cache.

9824.8M124](/packages/tedivm-stash)[tedivm/stash-bundle

Incorporates the Stash caching library into Symfony.

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

Simple cache abstraction layer implementing PSR-16

541.2M3](/packages/sabre-cache)[cache/memcached-adapter

A PSR-6 cache implementation using Memcached. This implementation supports tags

161.9M14](/packages/cache-memcached-adapter)[aplus/cache

Aplus Framework Cache Library

161.6M4](/packages/aplus-cache)[robinn/phpcacheadmin

A web dashboard for your favorite caching system.

4441.1k1](/packages/robinn-phpcacheadmin)

PHPackages © 2026

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