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

ActiveMarko-module[Caching](/categories/caching)

marko/cache
===========

Cache interfaces and infrastructure for Marko Framework

0.7.0(3w ago)0157↓20%6MITPHPPHP ^8.5

Since Mar 25Pushed 2w agoCompare

[ Source](https://github.com/marko-php/marko-cache)[ Packagist](https://packagist.org/packages/marko/cache)[ RSS](/packages/marko-cache/feed)WikiDiscussions develop Synced 3w ago

READMEChangelogDependencies (12)Versions (18)Used By (6)

marko/cache
===========

[](#markocache)

Interfaces for caching --- defines how data is stored, retrieved, and expired, not how the backend works.

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

[](#installation)

```
composer require marko/cache
```

Note: You typically install a driver package (like `marko/cache-file`) which requires this automatically.

Quick Example
-------------

[](#quick-example)

```
use Marko\Cache\Contracts\CacheInterface;

class ProductService
{
    public function __construct(
        private CacheInterface $cache,
    ) {}

    public function getProduct(int $id): Product
    {
        $key = "product.$id";

        if ($this->cache->has($key)) {
            return $this->cache->get($key);
        }

        $product = $this->repository->find($id);
        $this->cache->set($key, $product, ttl: 3600);

        return $product;
    }
}
```

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

[](#documentation)

Full usage, API reference, and examples: [marko/cache](https://marko.build/docs/packages/cache/)

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance95

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity50

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

Recently: every ~15 days

Total

16

Last Release

27d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/437029?v=4)[Mark Shust](/maintainers/markshust)[@markshust](https://github.com/markshust)

---

Top Contributors

[![markshust](https://avatars.githubusercontent.com/u/437029?v=4)](https://github.com/markshust "markshust (20 commits)")

###  Code Quality

TestsPest

### Embed Badge

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

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

PHPackages © 2026

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