PHPackages                             felixmaier1989/soft-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. felixmaier1989/soft-cache

ActiveLibrary[Caching](/categories/caching)

felixmaier1989/soft-cache
=========================

Soft cache for your class methods

0.2(8y ago)050.8k1[1 PRs](https://github.com/felixmaier1989/soft-cache/pulls)MITPHPPHP &gt;=5.5.0

Since Mar 22Pushed 7y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

soft-cache
==========

[](#soft-cache)

Soft cache for your class methods. Sometimes, during one script run, one method is executed several times with the same arguments. Better caching the output of it, especially when querying a databse or an API.

Usage
-----

[](#usage)

```
class TestClass {

	use SoftCache\SoftCacheTrait;

	public function getNextYearsWithCache($yearFrom, $years) {
		if ($this->checkMethodCache(__FUNCTION__, func_get_args())) {
			return $this->readMethodCache(__FUNCTION__, func_get_args());
		}
		$output = $this->getNextYearsWithoutCache($yearFrom, $years);
		$this->writeMethodCache(__FUNCTION__, func_get_args(), $output);
		return $output;
	}

	public function getNextYearsWithoutCache($yearFrom, $years) {
		return range($yearFrom + 1 , $yearFrom + $years);
	}

}
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

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.

###  Release Activity

Cadence

Every ~196 days

Total

2

Last Release

3140d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/02fbf70ae012375245c69ee5fbc29c8554be73c191a320b9855884bee9b3d992?d=identicon)[felixmaier1989](/maintainers/felixmaier1989)

---

Top Contributors

[![felixmaier1989](https://avatars.githubusercontent.com/u/10077436?v=4)](https://github.com/felixmaier1989 "felixmaier1989 (8 commits)")

---

Tags

phpclasscachemethodoutput

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/felixmaier1989-soft-cache/health.svg)

```
[![Health](https://phpackages.com/badges/felixmaier1989-soft-cache/health.svg)](https://phpackages.com/packages/felixmaier1989-soft-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)
