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

ActiveLibrary[Caching](/categories/caching)

harmonyio/cache
===============

Asynchronous caching library

v1.0.0-rc1(7y ago)34.1k↓30%2[9 PRs](https://github.com/HarmonyIO/Cache/pulls)1MITPHPPHP ^7.3

Since Dec 28Pushed 4y ago1 watchersCompare

[ Source](https://github.com/HarmonyIO/Cache)[ Packagist](https://packagist.org/packages/harmonyio/cache)[ RSS](/packages/harmonyio-cache/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (10)Versions (11)Used By (1)

Cache
=====

[](#cache)

[![Latest Stable Version](https://camo.githubusercontent.com/f839cfd04060ae414a44b824062101c9881276c84a2b2549c8078eede96895cd/68747470733a2f2f706f7365722e707567782e6f72672f6861726d6f6e79696f2f63616368652f762f737461626c65)](https://packagist.org/packages/harmonyio/cache)[![Build Status](https://camo.githubusercontent.com/c4baf8091673eae41c998223e15e8676ed8a1b40bfe2d7bbf50f820c880a1c68/68747470733a2f2f7472617669732d63692e6f72672f4861726d6f6e79494f2f43616368652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/HarmonyIO/Cache)[![Build status](https://camo.githubusercontent.com/e5e5e731969ebd3bd501da537cf11b9c181424e1197f2153c1451b77d14671ba/68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f336f6872726d3430676d6d656d6437692f6272616e63682f6d61737465723f7376673d74727565)](https://ci.appveyor.com/project/PeeHaa/cache/branch/master)[![Coverage Status](https://camo.githubusercontent.com/e3f258b0f08ffc61203d37d7da45e697a8b0329e385f0777e4bcf40703a16de6/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4861726d6f6e79494f2f43616368652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/HarmonyIO/Cache?branch=master)[![License](https://camo.githubusercontent.com/c28f81a576d9d5485275153fac27dfd10c0a2e2d9dbb2a6968cdb2c4ef0261fc/68747470733a2f2f706f7365722e707567782e6f72672f6861726d6f6e79696f2f63616368652f6c6963656e7365)](https://packagist.org/packages/harmonyio/cache)

Async caching library

Requirements
------------

[](#requirements)

- PHP 7.3
- Redis (if wanting to use the Redis caching provider)

In addition for non-blocking context one of the following event libraries should be installed:

- [ev](https://pecl.php.net/package/ev)
- [event](https://pecl.php.net/package/event)
- [php-uv](https://github.com/bwoebi/php-uv)

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

[](#installation)

```
composer require harmonyio/cache

```

Usage
-----

[](#usage)

This library both provides interfaces for working with the cache from external libraries as well as providing a way to interface with the cache directly.

This is mostly intended to be used by cache aware libraries and should in most cases not be worked with directly as this is a low-level library.

### Complete example usage

[](#complete-example-usage)

```
