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

ActiveLibrary[Caching](/categories/caching)

jaredchu/simple-cache
=====================

Simple PHP object caching base on temp file

v1.1.1(8y ago)31.4k2[1 issues](https://github.com/jaredchu/simple-cache/issues)MITPHPPHP &gt;=5.5

Since Aug 9Pushed 7y ago1 watchersCompare

[ Source](https://github.com/jaredchu/simple-cache)[ Packagist](https://packagist.org/packages/jaredchu/simple-cache)[ RSS](/packages/jaredchu-simple-cache/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (7)Dependencies (2)Versions (9)Used By (0)

simple-cache
============

[](#simple-cache)

Simple PHP object caching base on temp file

[![Packagist](https://camo.githubusercontent.com/b15ff9e6521e56bbee8104ee4cb480448180d8346798dad90d7b1e8574d0dc72/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a617265646368752f73696d706c652d63616368652e737667)](https://packagist.org/packages/jaredchu/simple-cache)[![Packagist](https://camo.githubusercontent.com/b97375fdc4a18c2b09589ff7b02a11600d42cfda570b17089679335837ed743c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a617265646368752f73696d706c652d63616368652e737667)](https://packagist.org/packages/jaredchu/simple-cache)[![Travis](https://camo.githubusercontent.com/4057efce447b02d14f39f172b346edf293ec571388863d9a0f46c2caaa1d0455/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6a617265646368752f53696d706c652d43616368652e737667)](https://travis-ci.org/jaredchu/Simple-Cache)[![Scrutinizer](https://camo.githubusercontent.com/61edbb8dce8c2f579ad59d309053c33fd37bd90826497f6e81cdc94689e9d1b3/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6a617265646368752f53696d706c652d43616368652e737667)](https://scrutinizer-ci.com/g/jaredchu/Simple-Cache/)[![Codecov](https://camo.githubusercontent.com/43e59dcb02e6b374e526eec204ea263698a511165ca9430f190320d1e74662cb/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6a617265646368752f53696d706c652d43616368652e737667)](https://codecov.io/gh/jaredchu/simple-cache)[![Packagist](https://camo.githubusercontent.com/c1ed9f4c1ff3fcb180508c572ce471ecc04bb2ad2dec493be393a345bdc77dc1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a617265646368752f73696d706c652d63616368652e737667)](https://packagist.org/packages/jaredchu/simple-cache)[![FOSSA Status](https://camo.githubusercontent.com/0354187057aac2bba5ff231667070b73667394ea23c6d978a422788e33fb2333/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f67697425324268747470732533412532462532466769746875622e636f6d2532466a6172656463687525324653696d706c652d43616368652e7376673f747970653d736869656c64)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fjaredchu%2FSimple-Cache?ref=badge_shield)

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

[](#installation)

`$ composer require jaredchu/simple-cache`

Usage
-----

[](#usage)

#### Quick start

[](#quick-start)

```
use JC\Cache\SimpleCache;

// store your object
SimpleCache::add('your-key', new Person('Jared', 27));

// check if exists
SimpleCache::exists('your-key');

// fetch your object
$person = SimpleCache::fetch('your-key', Person::class);

// remove your cache
SimpleCache::remove('your-key');
```

#### Add

[](#add)

```
// cache object Person with lifetime 1000 seconds (default is 0, not expire)
SimpleCache::add('your-key', new Person('Jared', 27), 1000);
```

#### Fetch

[](#fetch)

```
if(SimpleCache::exists('your-key')){
  $person = SimpleCache::fetch('your-key', Person::class);
  $person->sayHi();
}
```

#### Remove

[](#remove)

```
SimpleCache::remove('your-key');
```

#### Security

[](#security)

```
// your data is already encrypt but you can set your own encrypt key
SimpleCache::setEncryptKey('your unique string');
SimpleCache::add('your-key', new Person('Jared', 27));

// you must set encrypt key again if you want to call fetch in another session
SimpleCache::setEncryptKey('your unique string');
$person = SimpleCache::fetch('your-key', Person::class);
```

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

[](#contributing)

1. Fork it!
2. Create your feature branch: `$ git checkout -b feature/your-new-feature`
3. Commit your changes: `$ git commit -am 'Add some feature'`
4. Push to the branch: `$ git push origin feature/your-new-feature`
5. Submit a pull request.

License
-------

[](#license)

[MIT License](https://github.com/jaredchu/Simple-Cache/blob/master/LICENSE)

[![FOSSA Status](https://camo.githubusercontent.com/caaeafda2ff40064e0f73ab09d17a56030939f300c4dafba07ae29c239183f16/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f67697425324268747470732533412532462532466769746875622e636f6d2532466a6172656463687525324653696d706c652d43616368652e7376673f747970653d6c61726765)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fjaredchu%2FSimple-Cache?ref=badge_large)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 97.8% 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 ~10 days

Total

7

Last Release

3142d ago

Major Versions

v0.1-alpha → v1.0.02017-08-10

### Community

Maintainers

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

---

Top Contributors

[![jaredchu](https://avatars.githubusercontent.com/u/4394552?v=4)](https://github.com/jaredchu "jaredchu (45 commits)")[![fossabot](https://avatars.githubusercontent.com/u/29791463?v=4)](https://github.com/fossabot "fossabot (1 commits)")

---

Tags

cachecomposercomposer-packagepackagistphpphp7phpcache

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[awssat/laravel-visits

Laravel Redis visits counter for Eloquent models

975163.6k2](/packages/awssat-laravel-visits)[swayok/alternative-laravel-cache

Replacements for Laravel's redis and file cache stores that properly implement tagging idea. Powered by cache pool implementations provided by http://www.php-cache.com/

202541.1k6](/packages/swayok-alternative-laravel-cache)[eftec/cacheone

A Cache library with minimum dependency

103.5k4](/packages/eftec-cacheone)

PHPackages © 2026

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