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

ActiveLibrary[Caching](/categories/caching)

gustav/cache
============

A small and simple PHP cache system

v0.7(5y ago)2991GPLv3PHPPHP ^7.4

Since Nov 22Pushed 5y ago1 watchersCompare

[ Source](https://github.com/GustavSoftware/Cache)[ Packagist](https://packagist.org/packages/gustav/cache)[ Docs](http://gustav.fieselschweif.de)[ RSS](/packages/gustav-cache/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (4)Versions (10)Used By (1)

Cache
=====

[](#cache)

A small and simple PHP cache system, which implements [PSR-6](http://www.php-fig.org/psr/psr-6/) interfaces.

[![Build Status](https://camo.githubusercontent.com/a48c9dc93f2512c4c62f0461bb6d0226f744f29e04e75b6a8ccdc06d68a9c64a/68747470733a2f2f7472617669732d63692e6f72672f477573746176536f6674776172652f43616368652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/GustavSoftware/Cache)

Implementations
===============

[](#implementations)

- **Filesystem**: Each cache item pool is a simple file. Cache items are saved with help of PHP's default serialization method.
- **Debug**: Cache item pools will not be persisted. This is just for testing purposes. Don't use this implementation in production environments.

Usage
=====

[](#usage)

```
//configure the system
$config = new \Gustav\Cache\Configuration();
$config->setDirectory("path/to/my/cache/files/");

//load cache manager
$manager = \Gustav\Cache\ACacheManager::getInstance($config);

//fetch the item pool
$pool = $manager->getItemPool("myFileName", $myCreatorFunction);
```

Configuration
=============

[](#configuration)

You can set the following configurations in `\Gustav\Orm\Configuration`:

- `setImplementation(string)`: Sets the implementation of the cache manager to use here. Default is `\Gustav\Cache\Filesystem\CacheManager` (i.e. the Filesystem cache).
- `setDirectory(string)`: Sets the directory on filesystem, where we save the cache pool files. There's no default value.
- `setDefaultExpiration(integer)`: Sets the default time to live of cache items, if you don't set any explicitly in `\Gustav\Cache\CacheItem`. Consider that `0` and lower means, that the items will not expire. Default is `0`.
- `getLogConiguration(): \Gustav\Utils\Log\Configuration` / `setLogConfiguration(\Gustav\Utils\Log\Configuration)`: Configure the error log to use in this cache implementation. By default this uses the default configuration from Utils. See [Gustav Utils](https://github.com/GustavSoftware/Utils) for further information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

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

Recently: every ~388 days

Total

9

Last Release

2135d ago

PHP version history (4 changes)v0.1PHP &gt;=5.4

v0.4PHP &gt;=5.5

v0.5PHP ~7.0

v0.6PHP ^7.4

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

cachepsr-16psr-6

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[laminas/laminas-cache

Caching implementation with a variety of storage options, as well as codified caching strategies for callbacks, classes, and output

1076.9M130](/packages/laminas-laminas-cache)[cache/simple-cache-bridge

A PSR-6 bridge to PSR-16. This will make any PSR-6 cache compatible with SimpleCache.

423.1M27](/packages/cache-simple-cache-bridge)[codeigniter4/cache

PSR-6 and PSR-16 Cache Adapters for CodeIgniter 4

1320.1k](/packages/codeigniter4-cache)

PHPackages © 2026

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