PHPackages                             awonderphp/simplecacheapcu - 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. awonderphp/simplecacheapcu

ActiveLibrary[Caching](/categories/caching)

awonderphp/simplecacheapcu
==========================

An implementation of the PSR-16 SimpleCache Interface for APCu with optional AEAD encryption

1.2.1(8y ago)04MITPHPPHP ~7.1.0 || ~7.2.0

Since Mar 1Pushed 8y ago1 watchersCompare

[ Source](https://github.com/AliceWonderMiscreations/SimpleCacheAPCu)[ Packagist](https://packagist.org/packages/awonderphp/simplecacheapcu)[ Docs](https://github.com/AliceWonderMiscreations/SimpleCacheAPCu)[ RSS](/packages/awonderphp-simplecacheapcu/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (4)Dependencies (5)Versions (6)Used By (0)

SimpleCacheAPCu
===============

[](#simplecacheapcu)

This is an implementation of [PSR-16](https://www.php-fig.org/psr/psr-16/) for the APCu caching engine.

Two different classes are provided. The first just provides a PSR-16 compliant interface to APCu and the second provides encryption of the cached data via the libsodium extension.

Please refer to the files [`INSTALL.md`](INSTALL.md), [`USAGE.md`](USAGE.md), and [`SURVIVAL.md`](SURVIVAL.md) for more information specific to SimpleCacheAPCu.

For instructions specific to the encryption option, see the file [`SODIUM.md`](SODIUM.md).

Please refer to the file [`LICENSE.md`](LICENSE.md) for the terms of the MIT License this software is released under.

- [About APCu Caching](#about-apcu-caching)
- [About PHP-FIG and PSR-16](#about-php-fig-and-psr-16)
- [Coding Standard](#coding-standard)
- [About AWonderPHP](#about-awonderphp)

About APCu Caching
------------------

[](#about-apcu-caching)

[APCu](https://php.net/manual/en/book.apcu.php) caches `key => value` pairs in the web server memory. The `key` must be a string but the `value` can be any type that can be serialized.

Effective use of APCu can greatly improve the performance of your web applications, reducing how often your web application needs to make database or filesystem queries or process data from those queries.

The information can usually be retrieved straight from system memory already in the form your web application needs it to be in, radically reducing server response times to client queries.

APCu cache *only* lives in the web server memory. If you restart the web server daemon, everything stored is gone. If the web server needs the memory for its own uses, it will dump some or all of the `key => value` pairs.

If you wish to have a more persistent cache than APCu provides, you should use [SimpleCacheRedis](https://github.com/AliceWonderMiscreations/SimpleCacheRedis)instead.

When web applications need information that *can be* cached, a unique key for that information that should be used. The web application then attempts to fetch the needed information from the cache.

If it is there, the web application can then immediately use it resulting in fast response times. When the information is not there (what is called a ‘miss’) the web application then fetches the information by another means (e.g. database query with processing of the data) and then store it in the cache so it is highly *likely* to be there the next time it is queried from the cache.

If you need a networked cache, APCu is not the best choice for you, see the Redis link given earlier. However for local caching on the public facing server, it is incredibly lightweight and fast.

About PHP-FIG and PSR-16
------------------------

[](#about-php-fig-and-psr-16)

PHP-FIG is the [PHP Framework Interop Group](https://www.php-fig.org/). They exist largely to create standards that make it easier for different developers around the world to create different projects that will work well with each other. PHP-FIG was a driving force behind the PSR-0 and PSR-4 auto-load standards for example that make it *much much* easier to integrate PHP class libraries written by other people into your web applications.

The PHP-FIG previously released PSR-6 as a Caching Interface standard but the interface requirements of PSR-6 are beyond the needs of many web application developers. KISS - ‘Keep It Simple Silly’ applies for many of us who do not need some of the features PSR-6 requires.

To meet the needs of those of us who do not need what PSR-6 implements, [PSR-16](https://www.php-fig.org/psr/psr-16/) was developed and is now an accepted standard.

When I read PSR-16, the defined interface it was not *that* different from my own APCu caching class that I have personally been using for years. So I decided to make my class meet the interface requirements, and this is the result.

Coding Standard
---------------

[](#coding-standard)

The coding standard used is primarily [PSR-2](https://www.php-fig.org/psr/psr-2/) except with the closing `?>`allowed, and the addition of some [PHPDoc](https://en.wikipedia.org/wiki/PHPDoc) requirements largely but not completely borrowed from the [PEAR standard](http://pear.php.net/manual/en/standards.php).

The intent is switch PHPDoc standard to [PSR-5](https://github.com/phpDocumentor/fig-standards/blob/master/proposed/phpdoc.md)if it ever becomes an accepted standard.

The `phpcs` sniff rules being used: [psr2.phpcs.xml](psr2.phpcs.xml)

About AWonderPHP
----------------

[](#about-awonderphp)

I may become homeless before the end of 2018. I do not know how to survive, I try but what I try, it always seems to fail. This just is not a society people like me are meant to be a part of.

If I do become homeless, I fear my mental health will deteriorate at an accelerated rate and I do not want to witness that happening to myself.

AWonderPHP is my attempt to clean up and package a lot of the PHP classes I personally use so that something of me will be left behind.

If you wish to help, please see the [SURVIVAL.md](SURVIVAL.md) file.

Thank you for your time.

---

**EOF**

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

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

Total

4

Last Release

2976d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9ec318e5a43ebb10eaa0588a9c60ae1f576ab90070f692ca417498f70bf173ed?d=identicon)[AWonderPHP](/maintainers/AWonderPHP)

---

Top Contributors

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

---

Tags

apcucachelibsodiumphpphp-libraryphp7psr-16

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/awonderphp-simplecacheapcu/health.svg)

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

###  Alternatives

[laminas/laminas-cache

Caching implementation with a variety of storage options, as well as codified caching strategies for callbacks, classes, and output

1076.9M130](/packages/laminas-laminas-cache)[cache/adapter-common

Common classes for PSR-6 adapters

11124.4M38](/packages/cache-adapter-common)[cache/filesystem-adapter

A PSR-6 cache implementation using filesystem. This implementation supports tags

705.8M82](/packages/cache-filesystem-adapter)[cache/array-adapter

A PSR-6 cache implementation using a php array. This implementation supports tags

548.3M151](/packages/cache-array-adapter)[cache/redis-adapter

A PSR-6 cache implementation using Redis (PhpRedis). This implementation supports tags

523.9M27](/packages/cache-redis-adapter)[cache/simple-cache-bridge

A PSR-6 bridge to PSR-16. This will make any PSR-6 cache compatible with SimpleCache.

423.1M27](/packages/cache-simple-cache-bridge)

PHPackages © 2026

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