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

ActiveLibrary[Caching](/categories/caching)

aad/cache
=========

PHP cache library

2.0.0(4y ago)13447MITPHPPHP ^8.0CI failing

Since Feb 25Pushed 4y ago1 watchersCompare

[ Source](https://github.com/ademalidurmus/cache)[ Packagist](https://packagist.org/packages/aad/cache)[ RSS](/packages/aad-cache/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (10)Dependencies (4)Versions (13)Used By (0)

Cache
=====

[](#cache)

PHP cache library with PSR-16

[![Build Status](https://camo.githubusercontent.com/983751568bea8c3ce71fe4b3425cf85c8ae943880aa4eb7de05a8b23edaff721/68747470733a2f2f7472617669732d63692e636f6d2f4164656d416c694475726d75732f63616368652e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/AdemAliDurmus/cache)[![Latest Stable Version](https://camo.githubusercontent.com/95526a33839c4408bdb1fdeaa67bff41476a896bdb0f4a75a45493ca0f42d868/68747470733a2f2f706f7365722e707567782e6f72672f6161642f63616368652f762f737461626c65)](https://packagist.org/packages/aad/cache)[![Total Downloads](https://camo.githubusercontent.com/73d823ae30989f1a3f5ead607f0878c910a846826da94a43ea02bbfbe29d644e/68747470733a2f2f706f7365722e707567782e6f72672f6161642f63616368652f646f776e6c6f616473)](https://packagist.org/packages/aad/cache)[![License](https://camo.githubusercontent.com/37408ca2fdba6c21c369d456ed653acbb6335fe19d299fe781919fb86a6b9bdf/68747470733a2f2f706f7365722e707567782e6f72672f6161642f63616368652f6c6963656e7365)](https://packagist.org/packages/aad/cache)

Supported Drivers
-----------------

[](#supported-drivers)

- Files
- Redis
- Predis

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

[](#installation)

```
composer require aad/cache

```

Usage
-----

[](#usage)

```
use AAD\Cache\Cache;
use AAD\Cache\Drivers\Files\Files;
use AAD\Cache\Drivers\Redis\Redis;
use AAD\Cache\Drivers\Predis\Predis;

// for using files driver
$config = [
    'cache_dir' => __DIR__ . '/_cache_files_test', // cache file directory
    'cache_ttl' => 180, // set cache ttl
];
$driver = Files::init($config);

// for using redis driver
$connection = new \Redis();
$connection->connect('localhost', 6379);
$driver = Redis::init($connection);

// for using predis driver
$connection = new \Predis\Client();
$connection->connect('localhost', 6379);
$driver = Predis::init($connection);

$cache = new Cache($driver);

$cache->set('test_key', 'test_val'); // set cache with specific key
$cache->get('test_key', 'default_val'); // get cache value for specific key, if the key does not exist, you can return a default value
$cache->ttl('test_key'); // get key ttl
$cache->del('test_key'); // delete key
$cache->delete('test_key'); // delete key
$cache->hset('test_new_key', 'key', 'val'); // set hash value for specific key
$cache->hget('test_new_key', 'key'); // get hash value for specific key
$cache->hdel('test_new_key', 'key'); // delete hash value for specific key
$cache->expire('test_new_key', 10); // set ttl
$cache->hmset('test_hash_key', ['key_1' => 'val_1', 'key_2' => 'val_2']); // set cache for spesfic hash with key value pairs
$cache->hgetall('test_hash_key'); // get all values for spesfic hash
$cache->exists('test_hash_key'); // check key is exist
$cache->has('test_hash_key'); // check key is exist
$cache->flushall(); // delete all cache
$cache->clear(); // delete all cache
$cache->setMultiple(['key_1' => 'val_1', 'key_2' => 'val_2'], 10); // set cache for multiple key value pairs with ttl
$cache->getMultiple(['key_1', 'key_2', 'key_3'], 'default val'); // get cache for multiple keys, if some keys does not exist, you can return a default value
$cache->deleteMultiple(['key_1' => 'val_1', 'key_2' => 'val_2']); // delete cache for multiple key value pairs
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity68

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

Recently: every ~124 days

Total

12

Last Release

1541d ago

Major Versions

0.2.0 → 1.0.02020-02-27

1.3.2 → 2.0.02022-02-26

PHP version history (3 changes)0.1.0PHP ^7.3

1.3.2PHP ^7.3||^8.0

2.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0f5fcb264e69a9b32cdff14a58e670e317ce5dafa863dc2ff4eddf5bef08340e?d=identicon)[ademalidurmus](/maintainers/ademalidurmus)

---

Top Contributors

[![ademalidurmus](https://avatars.githubusercontent.com/u/22513266?v=4)](https://github.com/ademalidurmus "ademalidurmus (42 commits)")

---

Tags

rediscachefilecache

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[cache/redis-adapter

A PSR-6 cache implementation using Redis (PhpRedis). This implementation supports tags

523.9M27](/packages/cache-redis-adapter)[cache/predis-adapter

A PSR-6 cache implementation using Redis (Predis). This implementation supports tags

272.6M13](/packages/cache-predis-adapter)[rtcamp/nginx-helper

Cleans nginx's fastcgi/proxy cache or redis-cache whenever a post is edited/published. Also provides cloudflare edge cache purging with Cache-Tags.

23817.0k1](/packages/rtcamp-nginx-helper)

PHPackages © 2026

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