PHPackages                             cjrasmussen/data-cache-handler - 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. cjrasmussen/data-cache-handler

ActiveLibrary

cjrasmussen/data-cache-handler
==============================

Simple helper for caching data

1.1.0(11mo ago)07MITPHPPHP &gt;=7.4.0

Since Jun 10Pushed 11mo agoCompare

[ Source](https://github.com/cjrasmussen/DataCacheHandler)[ Packagist](https://packagist.org/packages/cjrasmussen/data-cache-handler)[ RSS](/packages/cjrasmussen-data-cache-handler/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

DataCacheHandler
================

[](#datacachehandler)

I've got a handful of scripts that function as notifiers. They run on a schedule and consume RSS feeds or API endpoints or scrape web pages. Then they compare the data retrieved with what was last retrieved and notify me of any changes.

To do that, they need a way of caching whatever "last retrieved" was. This is a simple helper class for doing that. It works for string data and anything that can be JSON encoded/decoded or serialized/unserialized.

Usage
-----

[](#usage)

```
use cjrasmussen\DataCacheHandler\DataCacheHandler;

$dataCacheHelper = new DataCacheHandler('/home/cjrasmussen/scripts/.cache/');

$dataCacheHelper->initialize(__FILE__);

$cache = $dataCache->readSerialized();

$cache[] = 'Some new item to cache';

$dataCacheHelper->writeSerialized();
```

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

[](#installation)

Simply add a dependency on cjrasmussen/DataCacheHandler to your composer.json file if you use [Composer](https://getcomposer.org/) to manage the dependencies of your project:

```
composer require cjrasmussen/DataCacheHandler
```

Although it's recommended to use Composer, you can actually include the file(s) any way you want.

License
-------

[](#license)

DataCacheHandler is [MIT](http://opensource.org/licenses/MIT) licensed.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance51

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

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

Total

2

Last Release

342d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0225f44837a665c8a143afa50a34a406a769c523dba31e4cdf73fd0530dede45?d=identicon)[cjrasmussen](/maintainers/cjrasmussen)

---

Top Contributors

[![cjrasmussen](https://avatars.githubusercontent.com/u/15007730?v=4)](https://github.com/cjrasmussen "cjrasmussen (2 commits)")

### Embed Badge

![Health badge](/badges/cjrasmussen-data-cache-handler/health.svg)

```
[![Health](https://phpackages.com/badges/cjrasmussen-data-cache-handler/health.svg)](https://phpackages.com/packages/cjrasmussen-data-cache-handler)
```

PHPackages © 2026

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