PHPackages                             jeroen/file-fetcher-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. jeroen/file-fetcher-cache

ActiveLibrary[Caching](/categories/caching)

jeroen/file-fetcher-cache
=========================

Provides a SimpleCache (PSR-16) decorator for file fetchers

1.1.0(3mo ago)1156.2k↓11.4%1[1 issues](https://github.com/JeroenDeDauw/file-fetcher-cache/issues)3GPL-2.0-or-laterPHPPHP &gt;=8.0CI failing

Since Jan 17Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/JeroenDeDauw/file-fetcher-cache)[ Packagist](https://packagist.org/packages/jeroen/file-fetcher-cache)[ GitHub Sponsors](https://github.com/JeroenDeDauw)[ Patreon](https://www.patreon.com/jeroendedauw)[ RSS](/packages/jeroen-file-fetcher-cache/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (9)Versions (7)Used By (3)

FileFetcher Cache
=================

[](#filefetcher-cache)

[![GitHub Workflow Status](https://camo.githubusercontent.com/83ef4007175fcfc7afa2192f72ed5659a042821890761ef78539428aa6deeb4e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f4a65726f656e4465446175772f66696c652d666574636865722d63616368652f4349)](https://github.com/JeroenDeDauw/file-fetcher-cache/actions?query=workflow%3ACI)[![Code Coverage](https://camo.githubusercontent.com/102f39186820565e3abe3ef1d2370bdc4345bdb0ce574f0193f9256461263618/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4a65726f656e4465446175772f66696c652d666574636865722d63616368652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/JeroenDeDauw/file-fetcher-cache/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/115566a0bb655b55e399e86c64903ec4f8ce5d45c4adf4569137f1d2de66f905/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4a65726f656e4465446175772f66696c652d666574636865722d63616368652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/JeroenDeDauw/file-fetcher-cache/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/c81465b9216d60fec6fe072dc8f451c8be9bee0d29e834e3fa24290708742b67/68747470733a2f2f706f7365722e707567782e6f72672f6a65726f656e2f66696c652d666574636865722d63616368652f76657273696f6e2e706e67)](https://packagist.org/packages/jeroen/file-fetcher-cache)[![Download count](https://camo.githubusercontent.com/04ad896350ca4c889b58ad10441bd6b63ccb0f81456b9150e30fa9690e79f6a8/68747470733a2f2f706f7365722e707567782e6f72672f6a65726f656e2f66696c652d666574636865722d63616368652f642f746f74616c2e706e67)](https://packagist.org/packages/jeroen/file-fetcher-cache)

Provides simple caching [decorators](https://en.wikipedia.org/wiki/Decorator_pattern)for [FileFetcher](https://github.com/JeroenDeDauw/FileFetcher) implementations.

Usage
-----

[](#usage)

The FileFetcher decorators are constructed via [`FileFetcher\Cache\Factory`](src/Factory.php).

- `$factory->newCachingFetcher()`: Caches file contents via [PSR-16 SimpleCache](https://www.php-fig.org/psr/psr-16/)
- `$factory->newJeroenSimpleCacheFetcher()`: Caches file contents via [jeroen/simple-cache](https://github.com/JeroenDeDauw/SimpleCache)

Once you constructed a FileFetcher, fetching a file is easy:

```
$fileContent = $fileFetcher->fetchFile($fileLocation);
```

To test your code you can use all the test doubles provided by [FileFetcher](https://github.com/JeroenDeDauw/FileFetcher) itself.

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

[](#installation)

To use the FileFetcher Cache library in your project, simply add a dependency on jeroen/file-fetcher-cache to your project's `composer.json` file. Here is a minimal example of a `composer.json`file that just defines a dependency on FileFetcher Cache 1.x:

```
{
    "require": {
        "jeroen/file-fetcher-cache": "~1.0"
    }
}
```

Development
-----------

[](#development)

Start by installing the project dependencies by executing

```
composer update

```

You can run the tests by executing

```
make test

```

You can run the style checks by executing

```
make cs

```

To run all CI checks, execute

```
make ci

```

You can also invoke PHPUnit directly to pass it arguments, as follows

```
vendor/bin/phpunit --filter SomeClassNameOrFilter

```

Release notes
-------------

[](#release-notes)

### 1.1.0 (2026-01-29)

[](#110-2026-01-29)

- Raised minimum PHP version to 8.0
- Raised minimum psr/simple-cache to 2.0
- Added support for psr/simple-cache 2 and 3

### 1.0.1 (2020-08-19)

[](#101-2020-08-19)

- Updated attribution in composer.json

### 1.0.0 (2019-01-17)

[](#100-2019-01-17)

Initial release with decorators for PSR-16 SimpleCache and jeroen/simple-cache.

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance59

Moderate activity, may be stable

Popularity35

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 68.4% 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 ~1284 days

Total

3

Last Release

110d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.1

1.1.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/451bd4039d530fed8f9c3da91bfa519233a397d2182cdfdcad700f6cfea19b7f?d=identicon)[Jeroen De Dauw](/maintainers/Jeroen%20De%20Dauw)

---

Top Contributors

[![JeroenDeDauw](https://avatars.githubusercontent.com/u/146040?v=4)](https://github.com/JeroenDeDauw "JeroenDeDauw (26 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (9 commits)")[![malberts](https://avatars.githubusercontent.com/u/1428594?v=4)](https://github.com/malberts "malberts (3 commits)")

---

Tags

cachecachingsimple-cachepsr-16file\_get\_contentsfile fetchersimplecachefilefetcher

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jeroen-file-fetcher-cache/health.svg)

```
[![Health](https://phpackages.com/badges/jeroen-file-fetcher-cache/health.svg)](https://phpackages.com/packages/jeroen-file-fetcher-cache)
```

###  Alternatives

[psr/simple-cache

Common interfaces for simple caching

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

Simple cache abstraction layer implementing PSR-16

541.2M3](/packages/sabre-cache)[voku/simple-cache

Simple Cache library

322.5M7](/packages/voku-simple-cache)[webarchitect609/bitrix-cache

Comfortable fluent interface for Bitrix cache. Anti-stampede cache protection.

2831.2k8](/packages/webarchitect609-bitrix-cache)[codeigniter4/cache

PSR-6 and PSR-16 Cache Adapters for CodeIgniter 4

1320.1k](/packages/codeigniter4-cache)

PHPackages © 2026

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