PHPackages                             herroffizier/limcache - 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. herroffizier/limcache

ActiveLibrary[Caching](/categories/caching)

herroffizier/limcache
=====================

Non-persistent cache manager with LRU and MRU algorithms

01.5kPHP

Since Feb 20Pushed 11y ago1 watchersCompare

[ Source](https://github.com/herroffizier/limcache)[ Packagist](https://packagist.org/packages/herroffizier/limcache)[ RSS](/packages/herroffizier-limcache/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Limcache
========

[](#limcache)

[![Build Status](https://camo.githubusercontent.com/f90574f3db670d9596bbb3b16e567ef4b113684c093cdc09af3b2488664fa036/68747470733a2f2f7472617669732d63692e6f72672f686572726f6666697a6965722f6c696d63616368652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/herroffizier/limcache) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/6f878de2c6fe0195db20e07edea6125b0f25c74e4cdeb740aecc9c78800285b1/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f686572726f6666697a6965722f6c696d63616368652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/herroffizier/limcache/?branch=master) [![Code Coverage](https://camo.githubusercontent.com/064f798ea40cbdcbc4394b26e261aea38341c4b44ef86c442cddb1ec1de55fd1/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f686572726f6666697a6965722f6c696d63616368652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/herroffizier/limcache/?branch=master) [![Code Climate](https://camo.githubusercontent.com/84c71450201007e6aba69d6dc896421f01f65fcb513fef766ad896e1c217c22a/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f686572726f6666697a6965722f6c696d63616368652f6261646765732f6770612e737667)](https://codeclimate.com/github/herroffizier/limcache)

**Limcache** is a small non-persistent cache manager that supports LRU and MRU replacement algorithms. Also it has optional [Judy](http://pecl.php.net/package/judy) support.

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

[](#requirements)

- PHP &gt;= 5.4
- [Judy](http://pecl.php.net/package/judy) (optional)

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

[](#installation)

You can install **Limcache** via Composer:

```
composer require herroffizier/limcache:dev-master

```

Usage
-----

[](#usage)

At first, choose replacement algorithm:

```
// Use LRU:
$strategy = new \Limcache\strategy\LRU(100); // 100 is max item count in cache

// Or MRU:
$strategy = new \Limcache\strategy\MRU(100);
```

After that you can create cache:

```
$cache = new \Limcache\Cache($strategy);
```

Since `\Limcache\Cache` implements `\ArrayAccess` and `\Countable` interfaces you can use it as array in most cases:

```
// Save item in cache:
$cache['key1'] = 'somedata';

// Get item value:
$cache['key1'];

// Try to get non-existent item:
$cache['key2']; // will return null

// Do some ordinary things:
count($cache);
isset($cache['key1']);
unset($cache['key1']);
```

In addition cache object has few useful methods which may help to determine cache efficiency:

```
// Get cache hits:
$cache->getHits();

// Get cache misses:
$cache->getMisses();
```

###  Health Score

23

—

LowBetter than 25% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/820232d3f5de11b08332a98ca93b025ab46d7e3563ddaec2ce6d042828718983?d=identicon)[herroffizier](/maintainers/herroffizier)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/herroffizier-limcache/health.svg)

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

###  Alternatives

[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

21114.2k](/packages/iazaran-smart-cache)[phpfastcache/phpssdb

PHP SSDB Driver for phpFastCache

14736.9k1](/packages/phpfastcache-phpssdb)[rapidwebltd/rw-file-cache

RW File Cache is a PHP File-based Caching Library. Its syntax is designed to closely resemble the PHP memcache extension.

15196.8k7](/packages/rapidwebltd-rw-file-cache)[yuzuru-s/redis-recommend

Wrapping Redis's sorted set APIs for specializing recommending operations.

392.9k](/packages/yuzuru-s-redis-recommend)[ichhabrecht/intcache

Turn uncachable page objects into cacheable links

193.9k](/packages/ichhabrecht-intcache)

PHPackages © 2026

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