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

ActiveLibrary[Caching](/categories/caching)

ciatog/redis-cache
==================

PHP Cache Wrapper for Redis

1.0.0(11y ago)07.3kMITPHPPHP &gt;=5.4.0

Since Jan 20Pushed 11y ago1 watchersCompare

[ Source](https://github.com/ciatog/PhpRedisCache)[ Packagist](https://packagist.org/packages/ciatog/redis-cache)[ Docs](https://github.com/ciatog/PhpRedisCache)[ RSS](/packages/ciatog-redis-cache/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

[![Build Status](https://camo.githubusercontent.com/110cfc91de15dd7e1be119d6bf07d1731ed4474643a345ac15fedb92bb27d1a6/68747470733a2f2f7472617669732d63692e6f72672f636961746f672f506870526564697343616368652e737667)](https://travis-ci.org/ciatog/PhpRedisCache)[![Coverage Status](https://camo.githubusercontent.com/86e3b0a93e23b5ce292828352b543680d6d2d6d5ce642a3485ce4f7cd5ec5cba/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f636961746f672f506870526564697343616368652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/r/ciatog/PhpRedisCache?branch=master)

PHP Redis Cache
===============

[](#php-redis-cache)

A PHP Cache Wrapper around Redis

This library serves as a wrapper around Redis so it can be used as a cache. It has the following features:

- The ability to set a unique context so you can use different caches in different circumstances. For instance, if you need to use the cache across multiple sites using the same Redis server you can pass in the site URL when creating the cache so each site has it's own cache context.
- Automatically serialises your data when saving it in the cache.
- Automatically deserialises your data when retrieving it from the cache.
- Gives the ability to pass an anonymous configuration function that will be called if the item doesn't exist and allows you to generate the value needed.

Usage
-----

[](#usage)

Install the latest version with `composer require ciatog/redis-cache`

```
