PHPackages                             qingbing/zf-wave-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. qingbing/zf-wave-cache

ActiveLibrary[Caching](/categories/caching)

qingbing/zf-wave-cache
======================

二级缓存管理

1.0.1(6y ago)021MITPHPPHP &gt;=7.0.0

Since Apr 10Pushed 6y ago1 watchersCompare

[ Source](https://github.com/qingbing/zf-wave-cache)[ Packagist](https://packagist.org/packages/qingbing/zf-wave-cache)[ Docs](http://www.phpcorner.net)[ RSS](/packages/qingbing-zf-wave-cache/feed)WikiDiscussions master Synced yesterday

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

zf-wave-cache
=============

[](#zf-wave-cache)

二级缓存实现，通过yac或memcache作为一级，redis或db作为二级实现

简介
==

[](#简介)

- WaveCache缓存类提供了二级缓存的封装
- 可以自定义一级和二级缓存组件，组件默认封装了Yac和Memcache作为本地缓存，redis作为远端缓存
- 一级（本地高速）缓存组件需要继承 "\\Zf\\WaveCache\\Interfaces\\ILocalCache"
- 二级（远端缓存）缓存组件需要继承 "\\Zf\\WaveCache\\Interfaces\\IRemoteCache"

使用范例
====

[](#使用范例)

```
// Redis 远端数据缓存组件，可参考redis，db等
$remoteCache = Object::create([
    'class' => RemoteRedisCache::class,
    'host' => '172.16.37.145',
    'port' => 6379,
    'password' => 'iampassword',
    'dbIndex' => 0,
]);

// Yac 本地高速缓存
$localCache = Object::create([
    'class' => LocalYacCache::class,
    'prefix' => 'zf:',
]);
// memcache 本地高速缓存
$localCache = Object::create([
    'class' => LocalMemCache::class,
    'host' => '172.16.37.128',
    'port' => 10000,
]);

// 二级缓存实例化
$cache = Object::create([
    'class' => WaveCache::class,
    'remoteCache' => $remoteCache,
    'localCache' => $localCache,
]);

$key = 'db:config';
$callback = function () {
    return [
        'host' => "localhost",
        'time' => time(),
    ];
};
/* @var $cache WaveCache */
// 设置缓存
$cache->set($key, $callback, 5);

// 获取缓存
$data = $cache->get($key, $callback, 5);
var_dump($data);

$status = $cache->del($key);
var_dump($status);
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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

Unknown

Total

1

Last Release

2223d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9379d2ee4885074de75faa3fa12970614186826f762df3c4aa0905dc1ff3b513?d=identicon)[qingbing](/maintainers/qingbing)

---

Top Contributors

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

---

Tags

phpcachezfwave

### Embed Badge

![Health badge](/badges/qingbing-zf-wave-cache/health.svg)

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

###  Alternatives

[awssat/laravel-visits

Laravel Redis visits counter for Eloquent models

975163.6k2](/packages/awssat-laravel-visits)[swayok/alternative-laravel-cache

Replacements for Laravel's redis and file cache stores that properly implement tagging idea. Powered by cache pool implementations provided by http://www.php-cache.com/

202541.1k6](/packages/swayok-alternative-laravel-cache)[eftec/cacheone

A Cache library with minimum dependency

103.5k4](/packages/eftec-cacheone)

PHPackages © 2026

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