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

ActiveLibrary[Caching](/categories/caching)

freshcells/cache
================

PSR-6 cache implementation with keyGenerator &amp; Compression

1.0.0(7y ago)24.2k—9.1%1MITPHPPHP ^7.1

Since Dec 21Pushed 2y ago3 watchersCompare

[ Source](https://github.com/freshcells/cache)[ Packagist](https://packagist.org/packages/freshcells/cache)[ Docs](https://github.com/freshcells/cache)[ RSS](/packages/freshcells-cache/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (6)Versions (2)Used By (0)

Cache
=====

[](#cache)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2252bc34b41b6ae8b4727c9e07460c00f5eaf64721fef4288530b6240829b385/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f667265736863656c6c732f63616368652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/freshcells/soap-client-bundle)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/5e208b8862e9d0a871a0d523db14af1e171db785f6e7100d307b07488765e848/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f667265736863656c6c732f63616368652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/freshcells/soap-client-bundle)[![Coverage Status](https://camo.githubusercontent.com/d94a0ce3846f9e11ac13ae3c8f2c3c1ed1839b317445616f706e04a1afe9ee2c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f667265736863656c6c732f63616368652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/freshcells/soap-client-bundle/code-structure)[![Quality Score](https://camo.githubusercontent.com/71c4fea1b18f258420295cbba27f892c38ebfaf5a601242a9978647aae3beb2c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f667265736863656c6c732f63616368652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/freshcells/soap-client-bundle)[![Total Downloads](https://camo.githubusercontent.com/2e017044db58cd4c4ed1a83319a85f54657b678bbaa5bc067e3db282192dc23e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f667265736863656c6c732f63616368652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/freshcells/soap-client-bundle)

PSR-6 Cache implementation with KeyGenerator and Compression.

### KeyGeneration

[](#keygeneration)

This is an extension to PSR-6.
Cache data by a given var as key.
This can be an object, an array or any var.
Key-generation with SerializeKeyGenerator will serialize and md5 the given var, further you can add a custom prefix to it.

You can also define your own KeyGenerator according your needs by implementing the interfaces.

It is designed to cache data by a variable resp. query-object and the key will be generated based on this var. If you know the cache-key beforehand you can directly use the cache-pool instance instead.

```
$keyVar      = new \stdClass();
$keyVar->foo = ['baz' => 'bif'];
$item = $cache->getItemByVar($keyVar);
$item->set($data);
$cache->save($item);
$itemFromCache = $cache->getItemByVar($keyVar);

```

### Compression

[](#compression)

Data can be compressed and data will be serialized before its passed to the cache if possible.

```
$compression    = new GzCompression();
$cache = CompressionCachePool($innerCachePool, $compression);

```

### Traits

[](#traits)

Cache aware Traits for normal PSR-6 `CacheItemPoolInterface` and extended `GeneratableKeyCache` are provided.

*CacheableTrait* and *GenerateableKeyCacheableTrait* provide wrapper method to fetch and save cache data.

```
    ...
    use CachePoolAwareTrait;
    use CacheableTrait;

    public function load()
    {
        return $this->cacheable(
            self::CACHE_KEY,
            function () {
                $entity = new TestEntity();

                return $entity;
            },
            function ($data) {
                return $data instanceof TestEntity;
            }
        );
    }
    ...

```

##### Todo

[](#todo)

Symfony Bridge Cache Bundle with CompilerPass for tag cacher.aware tag:

- name: 'cacher.aware', cache: cache.pool.service, enabled: %cache.enabled%

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

30

—

LowBetter than 67% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

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

Unknown

Total

1

Last Release

2647d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

cachepsr6

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[symfony/cache

Provides extended PSR-6, PSR-16 (and tags) implementations

4.2k341.5M2.1k](/packages/symfony-cache)[tedivm/stash

The place to keep your cache.

9624.8M115](/packages/tedivm-stash)[cache/tag-interop

Framework interoperable interfaces for tags

10524.6M11](/packages/cache-tag-interop)[cache/cache

Library of all the php-cache adapters

2712.7M20](/packages/cache-cache)[cache/adapter-common

Common classes for PSR-6 adapters

11024.1M37](/packages/cache-adapter-common)[cache/taggable-cache

Add tag support to your PSR-6 cache implementation

352.4M10](/packages/cache-taggable-cache)

PHPackages © 2026

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