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

ActiveLibrary[Caching](/categories/caching)

vakata/cache
============

A collection of caching classes with a common interface

3.3.2(2mo ago)16.4k↓78.2%12MITPHP

Since Dec 3Pushed 2mo ago2 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (28)Used By (2)

cache
=====

[](#cache)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4e95edeedf8db8227de8d56650cd22c2b832678fb25311ef379031b849ddb47a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76616b6174612f63616368652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vakata/cache)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/1fda47c4fdccb4d6e6f9cb97225c2933df39cb27b3ab658773080c074fab99fa/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f76616b6174612f63616368652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/vakata/cache)[![Code Climate](https://camo.githubusercontent.com/43960838298299ab7b40cfbd7328bdc7c4ba4c6b1587f4441a1bf977af7ecb7d/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6769746875622f76616b6174612f63616368652e7376673f7374796c653d666c61742d737175617265)](https://codeclimate.com/github/vakata/cache)[![Tests Coverage](https://camo.githubusercontent.com/9de2e345afff8cfc4974469ef7be00bb292e6cfabd6fb4a73f2c41a30aaa15c4/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f636f7665726167652f6769746875622f76616b6174612f63616368652e7376673f7374796c653d666c61742d737175617265)](https://codeclimate.com/github/vakata/cache)

A collection of caching classes with a common interface (currently file cache and memcached are supported).

Install
-------

[](#install)

Via Composer

```
$ composer require vakata/cache
```

Usage
-----

[](#usage)

```
// create an instance (with file based cache)
// caches will be stored in the dir specified by the first argument
$cache = new \vakata\cache\Filecache(__DIR__ . '/cache');
// to use Memcached instead simply create a memcached instance:
// $cache = new \vakata\cache\Memcache(); // by default connects to 127.0.0.1

// simple get / set
$cache->set('key', 'value'); // key is stored and "value" is returned
$cache->get('key'); // "value"

// using prepare ensures that a single client updates the cache at any given moment
$cache->prepare('long-running-operation');
$data = long_running_operation();
$cache->set('long-running-operation', $data);

// there is a special getSet method which gets the current key value and if it does not exist - invokes a callable, stores the result and returns it:
$cache->getSet('some-key', function () {
    return some_long_running_operation();
});
```

Read more in the [API docs](docs/README.md)

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [vakata](https://github.com/vakata)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

53

—

FairBetter than 96% of packages

Maintenance86

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity73

Established project with proven stability

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

Recently: every ~84 days

Total

27

Last Release

71d ago

Major Versions

1.0.0 → 2.0.02016-04-07

2.5.2 → 3.0.02024-01-17

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/146052?v=4)[Ivan Bozhanov](/maintainers/vakata)[@vakata](https://github.com/vakata)

---

Top Contributors

[![vakata](https://avatars.githubusercontent.com/u/146052?v=4)](https://github.com/vakata "vakata (55 commits)")

---

Tags

cachevakata

### Embed Badge

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

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

###  Alternatives

[laminas/laminas-cache

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

1077.3M154](/packages/laminas-laminas-cache)[sabre/cache

Simple cache abstraction layer implementing PSR-16

551.3M5](/packages/sabre-cache)[voku/simple-cache

Simple Cache library

332.7M10](/packages/voku-simple-cache)[graham-campbell/bounded-cache

A Bounded TTL PSR-16 Cache Implementation

112.1M10](/packages/graham-campbell-bounded-cache)[mmamedov/page-cache

PageCache is a lightweight PHP library for full page cache. It uses various strategies to differentiate among separate versions of the same page.

7913.3k1](/packages/mmamedov-page-cache)[infocyph/intermix

A lightweight PHP DI container, invoker, serializer, and utility toolkit.

137.7k2](/packages/infocyph-intermix)

PHPackages © 2026

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