PHPackages                             dtkahl/php-simple-redis-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. dtkahl/php-simple-redis-cache

ActiveLibrary[Caching](/categories/caching)

dtkahl/php-simple-redis-cache
=============================

1.0.1(9y ago)32731MITPHPPHP &gt;=5.6.0

Since Mar 19Pushed 7y agoCompare

[ Source](https://github.com/dtkahl/php-simple-redis-cache)[ Packagist](https://packagist.org/packages/dtkahl/php-simple-redis-cache)[ RSS](/packages/dtkahl-php-simple-redis-cache/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/2f4f8456e5b25db87040dc597cd899bfa94e21bfdb14b2f13022ad4e88a61ed1/68747470733a2f2f706f7365722e707567782e6f72672f64746b61686c2f7068702d73696d706c652d72656469732d63616368652f762f737461626c65)](https://packagist.org/packages/dtkahl/php-simple-redis-cache)[![License](https://camo.githubusercontent.com/8c7d6a8485167507f4787a61244357e8255510947fe5caa167968802a7c43ac8/68747470733a2f2f706f7365722e707567782e6f72672f64746b61686c2f7068702d73696d706c652d72656469732d63616368652f6c6963656e7365)](https://packagist.org/packages/dtkahl/php-simple-redis-cache)[![Build Status](https://camo.githubusercontent.com/79819af1d4172b13e9bb1dc23bb341fdd07f82ec3965c500dbd7a963a26495cc/68747470733a2f2f7472617669732d63692e6f72672f64746b61686c2f7068702d73696d706c652d72656469732d63616368652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dtkahl/php-simple-redis-cache)

PHP simple redis cache
======================

[](#php-simple-redis-cache)

This is a simple cache class for PHP using redis trough `predis/predis`.

#### Dependencies

[](#dependencies)

- `PHP >= 5.6.0`
- a redis server

#### Installation

[](#installation)

Install with [Composer](http://getcomposer.org):

```
composer require dtkahl/php-simple-redis-cache

```

### Usage

[](#usage)

Refer namespace:

```
use Dtkahl\SimpleRedisCache;

```

Create new Cache instance:

```
$cache = new Cache([
    "scheme" => "tcp",
    "host => "127.0.0.1",
    "port" => 6379
);
```

### Methods

[](#methods)

#### `put($key, $value, $time = null)`

[](#putkey-value-time--null)

Put item to cache. (time in seconds)

```
$cache->put('foo', 'bar', 60)
```

#### `has($key)`

[](#haskey)

Determinate if key exists in cache.

```
$cache->has('foo')
```

#### `get($key, $default = null)`

[](#getkey-default--null)

Return Item from cache or `$default`.

```
$cache->get('foo', 'default')
```

#### `forget($key)`

[](#forgetkey)

Remove item from cache.

```
$cache->forget('foo')
```

#### `forever($key, $value)`

[](#foreverkey-value)

Store item in cache forever.

```
$cache->forever('foo', 'bar')
```

#### `remember($key, $callback, $time = null)`

[](#rememberkey-callback-time--null)

Return cache item if exists otherwise call `$callback`, cache the returned value and return it.

```
$cache->put('foo')
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

Total

2

Last Release

3429d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/67396034?v=4)[dtkahl](/maintainers/dtkahl)[@dtkahl](https://github.com/dtkahl)

---

Top Contributors

[![dantodev](https://avatars.githubusercontent.com/u/13280775?v=4)](https://github.com/dantodev "dantodev (5 commits)")

---

Tags

cachephpredisredis-cache

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dtkahl-php-simple-redis-cache/health.svg)

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

###  Alternatives

[bagisto/bagisto

Bagisto Laravel E-Commerce

28.0k175.2k9](/packages/bagisto-bagisto)[unopim/unopim

UnoPim Laravel PIM

10.8k2.5k](/packages/unopim-unopim)[rhubarbgroup/redis-cache

A persistent object cache backend for WordPress powered by Redis. Supports Predis, PhpRedis, Relay, replication, sentinels, clustering and WP-CLI.

535103.2k1](/packages/rhubarbgroup-redis-cache)[millipress/millicache

WordPress Full-Page Cache based on Rules &amp; Flags. Delivers flexible, scalable caching workflows backed by Redis and ValKey in-memory stores.

734.4k3](/packages/millipress-millicache)[symfony-bundles/redis-bundle

Symfony Redis Bundle

271.2M7](/packages/symfony-bundles-redis-bundle)[lion/bundle

Lion-framework configuration and initialization package

132.4k5](/packages/lion-bundle)

PHPackages © 2026

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