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

ActiveLibrary[Caching](/categories/caching)

sabre/cache
===========

Simple cache abstraction layer implementing PSR-16

2.0.2(1y ago)541.2M—7.4%10[4 issues](https://github.com/sabre-io/cache/issues)[3 PRs](https://github.com/sabre-io/cache/pulls)3BSD-3-ClausePHPPHP ^7.4 || ^8.0CI passing

Since Jan 3Pushed 1mo ago10 watchersCompare

[ Source](https://github.com/sabre-io/cache)[ Packagist](https://packagist.org/packages/sabre/cache)[ Docs](http://sabre.io/dav/)[ RSS](/packages/sabre-cache/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (7)Versions (11)Used By (3)

sabre/cache
===========

[](#sabrecache)

This repository is a simple abstraction layer for key-value caches. It implements [PSR-16](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-16-simple-cache.md).

If you need a super-simple way to support PSR-16, sabre/cache helps you get started. It's as hands-off as possible.

It also comes with a test-suite that can be used by other PSR-16 implementations.

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

[](#installation)

Make sure you have [composer](http://getcomposer.org/) installed, and then run:

```
composer require sabre/cache

```

Usage
-----

[](#usage)

Read [PSR-16](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-16-simple-cache.md) for the API. We follow it to the letter.

### In-memory cache

[](#in-memory-cache)

This is useful as a test-double for long-running processes. The `Memory` cache only lasts as long as the object does.

```
$cache = new \Sabre\Cache\Memory();
```

### APCu cache

[](#apcu-cache)

This object uses the [APCu](http://php.net/apcu) api for caching. It's a fast memory cache that's shared by multiple PHP processes.

```
$cache = new \Sabre\Cache\Apcu();
```

### Memcached cache

[](#memcached-cache)

This object uses the [Memcached](http://php.net/apcu) extension for caching.

```
$memcached = new \Memcached();
$memcached->addServer('127.0.0.1', 11211);
$cache = new \Sabre\Cache\Memcached($memcached);
```

You are responsible for configuring memcached, and you just pass a fully instantiated objected to the `\Sabre\Cache\Memcached` constructor.

Build status
------------

[](#build-status)

branchstatusmaster[![Build Status](https://camo.githubusercontent.com/932a454b9ea9a69cbd85546ca52847fb04449683485f831dca6bf0528501379e/68747470733a2f2f7472617669732d63692e6f72672f73616272652d696f2f63616368652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/sabre-io/cache)Questions?
----------

[](#questions)

Head over to the [sabre/dav mailinglist](http://groups.google.com/group/sabredav-discuss), or you can also just open a ticket on [GitHub](https://github.com/fruux/sabre-cache/issues/).

Made at fruux
-------------

[](#made-at-fruux)

This library is being developed by [fruux](https://fruux.com/). Drop us a line for commercial services or enterprise support.

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance65

Regular maintenance activity

Popularity52

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 75.2% 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 ~399 days

Recently: every ~355 days

Total

8

Last Release

629d ago

Major Versions

1.0.4 → 2.0.02022-08-23

PHP version history (4 changes)1.0.0PHP &gt;=7.0

1.0.2PHP ^7.1

1.0.3PHP ^7.1 || ^8.0

2.0.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/2ec28c32d012f276f61b0b58cabe3c8f674166732d9b20eeddc3f9807857ba10?d=identicon)[evert](/maintainers/evert)

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

---

Top Contributors

[![phil-davis](https://avatars.githubusercontent.com/u/1535615?v=4)](https://github.com/phil-davis "phil-davis (109 commits)")[![evert](https://avatars.githubusercontent.com/u/178960?v=4)](https://github.com/evert "evert (23 commits)")[![staabm](https://avatars.githubusercontent.com/u/120441?v=4)](https://github.com/staabm "staabm (5 commits)")[![DeepDiver1975](https://avatars.githubusercontent.com/u/1005065?v=4)](https://github.com/DeepDiver1975 "DeepDiver1975 (3 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![DominikTo](https://avatars.githubusercontent.com/u/1384635?v=4)](https://github.com/DominikTo "DominikTo (1 commits)")[![sdklab007](https://avatars.githubusercontent.com/u/13796685?v=4)](https://github.com/sdklab007 "sdklab007 (1 commits)")[![webinarium](https://avatars.githubusercontent.com/u/741349?v=4)](https://github.com/webinarium "webinarium (1 commits)")

---

Tags

cachesimple-cachepsr-16memcachedapcuapcmemcachesabre

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[desarrolla2/cache

Provides an cache interface for several adapters Apc, Apcu, File, Mongo, Memcache, Memcached, Mysql, Mongo, Redis is supported.

1322.5M47](/packages/desarrolla2-cache)[phpfastcache/phpfastcache

PHP Abstract Cache Class - Reduce your database call using cache system. Phpfastcache handles a lot of drivers such as Apc(u), Cassandra, CouchBase, Couchdb, Dynamodb, Firestore, Mongodb, Files, (P)redis, Leveldb, Memcache(d), Ravendb, Ssdb, Sqlite, Wincache, Xcache, Zend Data Cache.

2.4k5.0M130](/packages/phpfastcache-phpfastcache)[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)[robinn/phpcacheadmin

A web dashboard for your favorite caching system.

4441.1k1](/packages/robinn-phpcacheadmin)[ihor/cachalot

Cache a lot in a proper way (APC, XCache, Memcached, Redis, Couchbase)

2528.1k](/packages/ihor-cachalot)

PHPackages © 2026

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