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

ActiveLibrary[Caching](/categories/caching)

srustamov/cache
===============

Php Cache Library

1.0.2(6y ago)220MITPHPPHP &gt;=7.0.0

Since Aug 9Pushed 6y ago1 watchersCompare

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

READMEChangelog (1)DependenciesVersions (4)Used By (0)

Php Cache Library
-----------------

[](#php-cache-library)

[![Build Status](https://camo.githubusercontent.com/4d9780100c9dc00dfe340a2ea8c986ad2393cb438393f44b2fdb363bcc3d40d4/68747470733a2f2f7472617669732d63692e6f72672f7372757374616d6f762f63616368652e737667)](https://travis-ci.org/srustamov/cache)[![Total Downloads](https://camo.githubusercontent.com/f614ad11b26d64777daf335544bc24caa297073298021bae1bd7e58124e70c3c/68747470733a2f2f706f7365722e707567782e6f72672f7372757374616d6f762f63616368652f642f746f74616c2e737667)](https://packagist.org/packages/srustamov/cache)[![Latest Stable Version](https://camo.githubusercontent.com/5ebd30eaf75de5308ca0ab8b50341aa37fa320eee97dcfa40c78d56191c6af95/68747470733a2f2f706f7365722e707567782e6f72672f7372757374616d6f762f63616368652f762f737461626c652e737667)](https://packagist.org/packages/srustamov/cache)[![License](https://camo.githubusercontent.com/b38889f18ae65abee8389c250121d249ee112d274c7c710e4a718df8502cebf3/68747470733a2f2f706f7365722e707567782e6f72672f7372757374616d6f762f63616368652f6c6963656e73652e737667)](https://packagist.org/packages/srustamov/cache)

```
$ composer require srustamov/cache

```

> **Default configs \[srustamov/Cache/config.php\]**

```
 $cache = new Samir\Cache\Cache();
```

> **Or your config**

```
$cacheConfig = require 'your-config-file.php';

$cache = new Samir\Cache\Cache($cacheConfig /*,$adapter| default file*/);
```

> **Switch adapter \[default file\]**

```
$cache->adapter('redis');

//set value expire 10 seconds
$cache->put('key','value',10);
//Or
$cache->put('key','value')->expires(10);
//Or
$cache->expires(10)->put('key','value');

//set value expire forever
$cache->forever('key','value');

// set value expire 1 minute
$cache->put('key','value')->minutes(1);
//Or
$cache->minutes(1)->put('key','value');

// set value expire 2 hours
$cache->put('key','value')->hours(2);
//Or
$cache->hours(2)->put('key','value');

// set value expire 2 days
$cache->put('key','value')->day(2);
//Or
$cache->day(2)->put('key','value');

// set value expire 2 days
$cache->put('key','value')->day(2);
//Or
$cache->day(2)->put('key','value');

// get value
$cache->get('key');

// has key
$cache->has('key');

// forget key
$cache->forget('key');

// flush store
$cache->flush();
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

Total

3

Last Release

2454d ago

### Community

Maintainers

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

---

Top Contributors

[![srustamov](https://avatars.githubusercontent.com/u/22997563?v=4)](https://github.com/srustamov "srustamov (14 commits)")

---

Tags

phprediscache

### Embed Badge

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

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

###  Alternatives

[awssat/laravel-visits

Laravel Redis visits counter for Eloquent models

975163.6k2](/packages/awssat-laravel-visits)[cache/redis-adapter

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

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

A Cache library with minimum dependency

103.5k4](/packages/eftec-cacheone)

PHPackages © 2026

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