PHPackages                             thybag/php-simple-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. thybag/php-simple-cache

ActiveLibrary[Caching](/categories/caching)

thybag/php-simple-cache
=======================

Quick, talkative file cache helper

07PHP

Since Dec 9Pushed 7y ago1 watchersCompare

[ Source](https://github.com/thybag/Php-simple-cache)[ Packagist](https://packagist.org/packages/thybag/php-simple-cache)[ RSS](/packages/thybag-php-simple-cache/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Php simple cache
================

[](#php-simple-cache)

A quick simple PHP file caching library. Not recommended for production use. License: MIT

#### Features:

[](#features)

- Optional ability to bypass cache (for debugging)
- Human readable cache keys/paths
- Fallback to old cache on failure to load new data
- Talkative logging (Requires PSR logger)

Usage
-----

[](#usage)

`composer require thybag/php-simple-cache`

```
// Standard
$cache = new \thybag\PhpSimpleCache\Cache;
$result = $cache->get("key");

// static
$result = \thybag\PhpSimpleCache\StaticCache::get("key")

```

#### Methods

[](#methods)

- **read**($cache\_key, $max\_age, $fallback) - read an item from the cache. Return fallback if item is to old.
- **write**($cache\_key, $data) - write data to cache
- **delete**($cache\_key, $recursivedDelete) - delete item from cache (or entire folder optionally)
- **has**($key, $max\_age) - do we have a no stale version cached
- **age**($cache\_key) - current age of cache item (false if no cache found)
- **get**($cache\_key, $callback, $max\_page) - run a callback, caching contents

Settings can be changed via

- **setLogger**(PSR logger)
- **setOptions**(\['cache\_path'=&gt;, 'allow\_cache\_bypass', 'cache\_bypass\_keyword', 'default\_ttl'\])

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

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/e22d6c955042e97d5c5a68cc21b540dc6aa3fdb7f830d56274e51dbb6c10d13e?d=identicon)[bag](/maintainers/bag)

### Embed Badge

![Health badge](/badges/thybag-php-simple-cache/health.svg)

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

###  Alternatives

[predis/predis

A flexible and feature-complete Redis/Valkey client for PHP.

7.8k305.7M2.4k](/packages/predis-predis)[snc/redis-bundle

A Redis bundle for Symfony

1.0k39.4M67](/packages/snc-redis-bundle)[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)[wp-media/wp-rocket

Performance optimization plugin for WordPress

7431.3M3](/packages/wp-media-wp-rocket)[illuminate/cache

The Illuminate Cache package.

12835.6M1.4k](/packages/illuminate-cache)[colinmollenhour/php-redis-session-abstract

A Redis-based session handler with optimistic locking

6325.6M14](/packages/colinmollenhour-php-redis-session-abstract)

PHPackages © 2026

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