PHPackages                             bybzmt/lrucache - 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. bybzmt/lrucache

ActiveLibrary[Caching](/categories/caching)

bybzmt/lrucache
===============

LRU cache server

v1.0.3(9y ago)130Apache-2.0PHPPHP &gt;=5.3.0

Since Aug 14Pushed 9y ago1 watchersCompare

[ Source](https://github.com/bybzmt/lrucache)[ Packagist](https://packagist.org/packages/bybzmt/lrucache)[ Docs](http://github.com/bybzmt/lrucache)[ RSS](/packages/bybzmt-lrucache/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (5)Used By (0)

LRUCache
========

[](#lrucache)

这是一个使用LRU算法的cache服务 (LRU是指最后使用缓存)

cache中分不同的分组，每个分组有自己的容量和LRU维护

每次对指定key的数字进行写操作时，就会把这个key添加到 链表的开头。如果保存的key的个数达到上限，则会把链表尾的key给删除。

访问的方式为http请求 . 参数可以接受GET或POST方式 反回JSON `{err:0, data:data}`

错误类型:

- `0` 成功
- `1` 错误, 非特定错误
- `2` 分组不存在
- `3` key不存在
- `4` key己存在

\##各请求url介绍

\###累加 `/counter/incr`给指定key增加N，如果key不存在默认为0

参数:

- `group` 分组名
- `key` 键名
- `val` 数值

\###取出数值最大的的N个key `/counter/hot`

参数:

- `group` 分组名
- `len` 取出的key的个数

\###设置指定的key /cache/set

参数:

- `group` 分组名
- `key` 键名
- `val` 数值

\###取得指定的key的值 /cache/get

参数:

- `group` 分组名
- `key` 键名

\###删除指定的key /cache/del

参数:

- `group` 分组名
- `key` 键名

\###创建一个分组 /group/create

参数:

- `group` 分组名
- `cap` 分组容量
- `expire` 过期时间
- `saveTick` 定时保存同期，0 不定时保存
- `statusTick` 定时统状态同期，0 不统计

\###删除一个分组 /group/del

参数

- `group` 分组名

\###同时请求多个 `/multiple/` 这个地址再接上面的， 如 `/multiple/cache/get`参数是

```
$data = array();
//参数与上面的一至
$data[] = array('group'=>'group1', 'key'=>'key1');
$data[] = array('group'=>'group2', 'key'=>'key2');
reqs = json_encode($data)

程序会返回一个与请求数量一样至的一个数组，里面是每个请求的反回

```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Total

4

Last Release

3450d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

lrulrucache

### Embed Badge

![Health badge](/badges/bybzmt-lrucache/health.svg)

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

###  Alternatives

[cash/lrucache

An efficient memory-based Least Recently Used (LRU) cache

364.9M5](/packages/cash-lrucache)[lrucache/lrucache

PHP LRU Cache implementation

67121.8k3](/packages/lrucache-lrucache)[beryllium/cachebundle

Provides an interface to Memcache for Symfony2 applications

32136.0k](/packages/beryllium-cachebundle)

PHPackages © 2026

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