PHPackages                             gilbitron/php-simplecache - 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. gilbitron/php-simplecache

ActiveLibrary[Caching](/categories/caching)

gilbitron/php-simplecache
=========================

A simple script for caching 3rd party API calls in PHP.

1.4.2(9y ago)26137.3k↓22.2%455MITPHPPHP &gt;=5.3.0

Since Mar 25Pushed 6y ago30 watchersCompare

[ Source](https://github.com/gilbitron/PHP-SimpleCache)[ Packagist](https://packagist.org/packages/gilbitron/php-simplecache)[ Docs](https://github.com/gilbitron/PHP-SimpleCache)[ RSS](/packages/gilbitron-php-simplecache/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)DependenciesVersions (5)Used By (5)

PHP SimpleCache
===============

[](#php-simplecache)

The PHP SimpleCache Class is an easy way to cache 3rd party API calls.

Install
-------

[](#install)

Install via [composer](https://getcomposer.org):

```
{
    "require": {
        "gilbitron/php-simplecache": "~1.4"
    }
}
```

Run `composer install` then use as normal:

```
require 'vendor/autoload.php';
$cache = new Gilbitron\Util\SimpleCache();
```

Usage
-----

[](#usage)

A very basic usage example:

```
$cache = new Gilbitron\Util\SimpleCache();
$latest_tweet = $cache->get_data('tweet', 'http://search.twitter.com/search.atom?q=from:gilbitron&rpp=1');
echo $latest_tweet;
```

A more advanced example:

```
$cache = new Gilbitron\Util\SimpleCache();
$cache->cache_path = 'cache/';
$cache->cache_time = 3600;

if($data = $cache->get_cache('label')){
	$data = json_decode($data);
} else {
	$data = $cache->do_curl('http://some.api.com/file.json');
	$cache->set_cache('label', $data);
	$data = json_decode($data);
}

print_r($data);
```

Credits
-------

[](#credits)

PHP SimpleCache was created by [Gilbert Pellegrom](https://gilbitron.me) from [Dev7studios](https://dev7studios.co). Released under the MIT license.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity47

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 92% 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 ~343 days

Total

4

Last Release

3408d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/20011de485eeea26b5582c75daaab217937832762b5d5f551d34d07f74138bb0?d=identicon)[gilbitron](/maintainers/gilbitron)

---

Top Contributors

[![gilbitron](https://avatars.githubusercontent.com/u/203882?v=4)](https://github.com/gilbitron "gilbitron (23 commits)")[![brunomarks7](https://avatars.githubusercontent.com/u/28784176?v=4)](https://github.com/brunomarks7 "brunomarks7 (1 commits)")[![bxt](https://avatars.githubusercontent.com/u/639509?v=4)](https://github.com/bxt "bxt (1 commits)")

---

Tags

cachephpcachesimplecache

### Embed Badge

![Health badge](/badges/gilbitron-php-simplecache/health.svg)

```
[![Health](https://phpackages.com/badges/gilbitron-php-simplecache/health.svg)](https://phpackages.com/packages/gilbitron-php-simplecache)
```

###  Alternatives

[psr/simple-cache

Common interfaces for simple caching

8.1k727.3M2.1k](/packages/psr-simple-cache)[psr/cache

Common interface for caching libraries

5.2k686.9M1.3k](/packages/psr-cache)[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)[beste/in-memory-cache

A PSR-6 In-Memory cache that can be used as a fallback implementation and/or in tests.

2512.2M6](/packages/beste-in-memory-cache)[anahkiasen/flatten

A package for the Illuminate framework that flattens pages to plain HTML

33313.0k](/packages/anahkiasen-flatten)[rtcamp/nginx-helper

Cleans nginx's fastcgi/proxy cache or redis-cache whenever a post is edited/published. Also provides cloudflare edge cache purging with Cache-Tags.

23517.0k1](/packages/rtcamp-nginx-helper)

PHPackages © 2026

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