PHPackages                             cakephp/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. [Framework](/categories/framework)
4. /
5. cakephp/cache

ActiveLibrary[Framework](/categories/framework)

cakephp/cache
=============

Easy to use Caching library with support for multiple caching backends

5.3.3(2mo ago)498.5M—9.5%714MITPHPPHP &gt;=8.2

Since Nov 8Pushed 1mo ago28 watchersCompare

[ Source](https://github.com/cakephp/cache)[ Packagist](https://packagist.org/packages/cakephp/cache)[ Docs](https://cakephp.org)[ RSS](/packages/cakephp-cache/feed)WikiDiscussions 5.x Synced 1mo ago

READMEChangelogDependencies (6)Versions (337)Used By (14)

CakePHP Caching Library
=======================

[](#cakephp-caching-library)

The Cache library provides a `Cache` service locator for interfacing with multiple caching backends using a simple to use interface.

The caching backends supported are:

- Files
- APC
- Memcached
- Redis
- Xcache

Usage
-----

[](#usage)

Caching engines need to be configured with the `Cache::config()` method.

```
use Cake\Cache\Cache;

// Using a short name
Cache::config('default', [
    'className' => 'File',
    'duration' => '+1 hours',
    'path' => sys_get_tmp_dir(),
    'prefix' => 'my_app_'
]);

// Using a fully namespaced name.
Cache::config('long', [
    'className' => \Cake\Cache\Engine\ApcuEngine::class,
    'duration' => '+1 week',
    'prefix' => 'my_app_'
]);

// Using a constructed object.
$object = new FileEngine($config);
Cache::config('other', $object);
```

You can now read and write from the cache:

```
$data = Cache::remember('my_cache_key', function () {
	return Service::expensiveCall();
});
```

The code above will try to look for data stored in cache under the `my_cache_key`, if not found the callback will be executed and the returned data will be cached for future calls.

Documentation
-------------

[](#documentation)

Please make sure you check the [official documentation](https://book.cakephp.org/5/en/core-libraries/caching.html)

###  Health Score

73

—

ExcellentBetter than 100% of packages

Maintenance87

Actively maintained with recent releases

Popularity56

Moderate usage in the ecosystem

Community38

Small or concentrated contributor base

Maturity95

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

331

Last Release

65d ago

Major Versions

4.5.0-RC1 → 5.0.0-RC22023-05-09

4.5.9 → 5.1.0-RC22024-08-07

4.6.0 → 5.1.42024-11-22

4.6.1 → 5.2.02025-03-29

5.x-dev → 6.x-dev2026-03-15

PHP version history (8 changes)3.4.8PHP &gt;=5.6.0

4.0.0-alpha1PHP &gt;=7.1.0,&lt;7.3.0

4.0.0-beta1PHP &gt;=7.2.0

3.9.5PHP &gt;=5.6.0,&lt;8.0.0

4.4.0-RC1PHP &gt;=7.4.0

5.0.0-beta1PHP &gt;=8.1

5.3.0-RC1PHP &gt;=8.2

6.x-devPHP &gt;=8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23666?v=4)[CakePHP](/maintainers/cakephp)[@cakephp](https://github.com/cakephp)

---

Top Contributors

[![ADmad](https://avatars.githubusercontent.com/u/142658?v=4)](https://github.com/ADmad "ADmad (251 commits)")[![markstory](https://avatars.githubusercontent.com/u/24086?v=4)](https://github.com/markstory "markstory (241 commits)")[![dereuromark](https://avatars.githubusercontent.com/u/39854?v=4)](https://github.com/dereuromark "dereuromark (88 commits)")[![othercorey](https://avatars.githubusercontent.com/u/24221186?v=4)](https://github.com/othercorey "othercorey (51 commits)")[![lorenzo](https://avatars.githubusercontent.com/u/37621?v=4)](https://github.com/lorenzo "lorenzo (37 commits)")[![ravage84](https://avatars.githubusercontent.com/u/625761?v=4)](https://github.com/ravage84 "ravage84 (34 commits)")[![josegonzalez](https://avatars.githubusercontent.com/u/65675?v=4)](https://github.com/josegonzalez "josegonzalez (10 commits)")[![AD7six](https://avatars.githubusercontent.com/u/33387?v=4)](https://github.com/AD7six "AD7six (8 commits)")[![LordSimal](https://avatars.githubusercontent.com/u/9105243?v=4)](https://github.com/LordSimal "LordSimal (8 commits)")[![jeremyharris](https://avatars.githubusercontent.com/u/184903?v=4)](https://github.com/jeremyharris "jeremyharris (8 commits)")[![bcrowe](https://avatars.githubusercontent.com/u/752603?v=4)](https://github.com/bcrowe "bcrowe (7 commits)")[![dakota](https://avatars.githubusercontent.com/u/83255?v=4)](https://github.com/dakota "dakota (7 commits)")[![Harfusha](https://avatars.githubusercontent.com/u/47174548?v=4)](https://github.com/Harfusha "Harfusha (6 commits)")[![antograssiot](https://avatars.githubusercontent.com/u/4977112?v=4)](https://github.com/antograssiot "antograssiot (6 commits)")[![garas](https://avatars.githubusercontent.com/u/2265694?v=4)](https://github.com/garas "garas (6 commits)")[![chinpei215](https://avatars.githubusercontent.com/u/7399393?v=4)](https://github.com/chinpei215 "chinpei215 (5 commits)")[![burzum](https://avatars.githubusercontent.com/u/162789?v=4)](https://github.com/burzum "burzum (5 commits)")[![nicosp](https://avatars.githubusercontent.com/u/4110066?v=4)](https://github.com/nicosp "nicosp (5 commits)")[![CauanCabral](https://avatars.githubusercontent.com/u/83092?v=4)](https://github.com/CauanCabral "CauanCabral (5 commits)")[![ndm2](https://avatars.githubusercontent.com/u/5031606?v=4)](https://github.com/ndm2 "ndm2 (5 commits)")

---

Tags

cakephpcachecaching

### Embed Badge

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

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

###  Alternatives

[cakephp/datasource

Provides connection managing and traits for Entities and Queries that can be reused for different datastores

4724.6M11](/packages/cakephp-datasource)[cakephp/utility

CakePHP Utility classes such as Inflector, String, Hash, and Security

12127.1M63](/packages/cakephp-utility)[cakephp/orm

CakePHP ORM - Provides a flexible and powerful ORM implementing a data-mapper pattern.

151242.6k70](/packages/cakephp-orm)[cakephp/database

Flexible and powerful Database abstraction library with a familiar PDO-like API

9824.6M33](/packages/cakephp-database)[cakephp/log

CakePHP logging library with support for multiple different streams

247.7M10](/packages/cakephp-log)[cakephp/validation

CakePHP Validation library

42506.9k13](/packages/cakephp-validation)

PHPackages © 2026

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