PHPackages                             amne/simple-cache-layers - 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. amne/simple-cache-layers

ActiveLibrary[Caching](/categories/caching)

amne/simple-cache-layers
========================

PSR16 implementation that reads and writes to a layered cache built from other PSR16 implementations

v0.1(1y ago)0258MITPHP

Since May 23Pushed 1y ago1 watchersCompare

[ Source](https://github.com/amne/simple-cache-layers)[ Packagist](https://packagist.org/packages/amne/simple-cache-layers)[ Docs](https://github.com/amne/simple-cache-layers)[ RSS](/packages/amne-simple-cache-layers/feed)WikiDiscussions main Synced 1mo ago

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

What?
=====

[](#what)

This is a PSR-16 implementation of a layered cache that is full of optimism. It assumes the cache is being used for speed and not for important things like throttling, sessions or things like that.

How?
====

[](#how)

Layers are also PSR-16 implementations. This means every method of the layered cache is delegated to all the layers depending on the desired outcome:

- `get()` and `getMultiple()` will return a value from the first layer that has it. When a value is found in a "lower" layer it gets synced back up to all the "higher" layers
- `set()` and `setMultiple()` will store a value in all the layers, starting from the "lowest" layer
- a companion key suffixed with `-layer-meta` is created for all stored keys to keep track of creation time and first TTL. This information is used during sync back.
- full of optimism: when things fail there is no rollback logic. If you set a key and it fails in a mid layer it just stops. This should be fine because `set()` starts with the lowest layer and the next `get()` will trigger a sync back

Why?
====

[](#why)

In a distributed context it can become a bottleneck to go out on the network to read a centralized cache all the time. Storing some information locally (in APC or even filesystem) with a short TTL should keep things going almost as fast as having everything cached only locally but still keep the control that a centralized cache like redis/memcache/couchbase gives you.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 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

724d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

psrcachecachingsimple-cachepsr-16layered-cache

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/amne-simple-cache-layers/health.svg)

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

###  Alternatives

[psr/simple-cache

Common interfaces for simple caching

8.1k727.3M2.1k](/packages/psr-simple-cache)[sabre/cache

Simple cache abstraction layer implementing PSR-16

541.2M3](/packages/sabre-cache)[voku/simple-cache

Simple Cache library

322.5M7](/packages/voku-simple-cache)[webarchitect609/bitrix-cache

Comfortable fluent interface for Bitrix cache. Anti-stampede cache protection.

2831.2k8](/packages/webarchitect609-bitrix-cache)

PHPackages © 2026

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