PHPackages                             dercoder/simple-cache-shared-memory - 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. dercoder/simple-cache-shared-memory

ActiveLibrary[Caching](/categories/caching)

dercoder/simple-cache-shared-memory
===================================

1.0.0(1y ago)08MITPHPPHP &gt;=7.3

Since Jul 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/dercoder/simple-cache-shared-memory)[ Packagist](https://packagist.org/packages/dercoder/simple-cache-shared-memory)[ RSS](/packages/dercoder-simple-cache-shared-memory/feed)WikiDiscussions main Synced yesterday

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

SimpleCache SharedMemory
========================

[](#simplecache-sharedmemory)

A simple cache implementation using shared memory in PHP.

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

[](#installation)

You can install the package using Composer:

```
composer require dercoder/simple-cache-shared-memory
```

Usage
-----

[](#usage)

```
use DerCoder\SimpleCache\SharedMemory\SharedMemoryCache;
use Psr\SimpleCache\CacheInterface;

$cache = new SharedMemoryCache('1M'); // 1MB shared memory segment

// Set cache items
$cache->set('key1', 'value1');
$cache->set('key2', [1, 2, 3], 60); // with TTL of 60 seconds

// Get cache items
$value1 = $cache->get('key1');
$value2 = $cache->get('key2');

// Check if a cache item exists
$hasKey1 = $cache->has('key1');

// Delete cache items
$cache->delete('key1');
```

TODO
----

[](#todo)

- Lock functions so multiple threads will not overwrite values
- Second release for PHP 8+

Contributing
------------

[](#contributing)

Contributions are welcome! Please feel free to open an issue or submit a pull request.

License
-------

[](#license)

This project is licensed under the MIT License - see the LICENSE file for details.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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

716d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d4045b607948c2b395b141c6c48749a42a719f11fb58956afd06ea5f246cdfa3?d=identicon)[DerCoder](/maintainers/DerCoder)

---

Top Contributors

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

---

Tags

cachesimple-cachepsr-16shared memoryshm

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dercoder-simple-cache-shared-memory/health.svg)

```
[![Health](https://phpackages.com/badges/dercoder-simple-cache-shared-memory/health.svg)](https://phpackages.com/packages/dercoder-simple-cache-shared-memory)
```

###  Alternatives

[sabre/cache

Simple cache abstraction layer implementing PSR-16

551.3M5](/packages/sabre-cache)[n1ebieski/ksef-php-client

PHP API client that allows you to interact with the API Krajowego Systemu e-Faktur

9067.8k](/packages/n1ebieski-ksef-php-client)

PHPackages © 2026

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