PHPackages                             slam/flysystem-local-cache-proxy - 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. slam/flysystem-local-cache-proxy

ActiveLibrary[Caching](/categories/caching)

slam/flysystem-local-cache-proxy
================================

FlySystem adapter to cache locally the content of files

v0.1.0(4y ago)18[1 issues](https://github.com/Slamdunk/flysystem-local-cache-proxy/issues)MITPHPPHP &gt;=8.0

Since Dec 3Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Slamdunk/flysystem-local-cache-proxy)[ Packagist](https://packagist.org/packages/slam/flysystem-local-cache-proxy)[ Docs](https://github.com/slamdunk/flysystem-local-cache-proxy)[ Fund](https://paypal.me/filippotessarotto)[ GitHub Sponsors](https://github.com/Slamdunk)[ RSS](/packages/slam-flysystem-local-cache-proxy/feed)WikiDiscussions master Synced 1w ago

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

Slam / flysystem-local-cache-proxy
==================================

[](#slam--flysystem-local-cache-proxy)

[![Latest Stable Version](https://camo.githubusercontent.com/e422c081c0c012e855a8ad7d85e2fd8bd8a0a1baf157548e846f7c368a1a64a4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736c616d2f666c7973797374656d2d6c6f63616c2d63616368652d70726f78792e737667)](https://packagist.org/packages/slam/flysystem-local-cache-proxy)[![Downloads](https://camo.githubusercontent.com/7492a99388ca9b55a3612de0b2c908f2812a5faa5ea4d859ef5628b3988fe95a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736c616d2f666c7973797374656d2d6c6f63616c2d63616368652d70726f78792e737667)](https://packagist.org/packages/slam/flysystem-local-cache-proxy)[![Integrate](https://github.com/Slamdunk/flysystem-local-cache-proxy/workflows/Integrate/badge.svg?branch=master)](https://github.com/Slamdunk/flysystem-local-cache-proxy/actions)[![Code Coverage](https://camo.githubusercontent.com/cb8afa8ce8f3e5b55aded51965a7739ffb6230ba1231c2f7ceb924fd9fca967d/68747470733a2f2f636f6465636f762e696f2f67682f536c616d64756e6b2f666c7973797374656d2d6c6f63616c2d63616368652d70726f78792f636f7665726167652e7376673f6272616e63683d6d6173746572)](https://codecov.io/gh/Slamdunk/flysystem-local-cache-proxy?branch=master)[![Type Coverage](https://camo.githubusercontent.com/4ed72241fc624061400c578153ac8206f194d23848388c08ff3c34df06862ce5/68747470733a2f2f73686570686572642e6465762f6769746875622f536c616d64756e6b2f666c7973797374656d2d6c6f63616c2d63616368652d70726f78792f636f7665726167652e737667)](https://shepherd.dev/github/Slamdunk/flysystem-local-cache-proxy)[![Infection MSI](https://camo.githubusercontent.com/090a8f0edaf674a121094004ffe272daeb6b169f8339f7a4d84d6f2dbd304552/68747470733a2f2f62616467652e737472796b65722d6d757461746f722e696f2f6769746875622e636f6d2f536c616d64756e6b2f666c7973797374656d2d6c6f63616c2d63616368652d70726f78792f6d6173746572)](https://dashboard.stryker-mutator.io/reports/github.com/Slamdunk/flysystem-local-cache-proxy/master)

Save to local disk a copy of written and read files to speed up next reads.

Keep local disk cache small by clearing unfrequently accessed files.

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

[](#installation)

Use composer to install these available packages:

```
$ composer install slam/flysystem-local-cache-proxy
```

Usage
-----

[](#usage)

```
use SlamFlysystem\LocalCache\LocalCacheProxyAdapter;
use League\Flysystem\AwsS3V3\AwsS3V3Adapter;

$adapter = new LocalCacheProxyAdapter(
    new AwsS3V3Adapter(/* ... */),
    __DIR__ . '/tmp/flysystem-cache'
);

// The FilesystemOperator
$filesystem = new \League\Flysystem\Filesystem($adapter);

// Upload a file, with stream
$handle = fopen('robots.txt', 'r');
$filesystem->writeStream('robots.txt', $handle);
fclose($handle);

// robots.txt is now present both on Aws and locally

// Read the file: no actual hit on Aws
// Each read/readStream refreshes the cache timestamp
$handle = $filesystem->readStream('robots.txt');
echo stream_get_contents('robots.txt', $handle);
fclose($handle);

// Clear infrequently used files to save disk space
$adapter->clearCacheOlderThan((new DateTime)->modify('-1 week'));

// Manually keep fresh a file you know it gets accessed frequently anyway
$adapter->touch('robots.txt', new DateTime);
```

What about the other packages?
------------------------------

[](#what-about-the-other-packages)

1. [`league/flysystem-cached-adapter`](https://github.com/thephpleague/flysystem-cached-adapter)is for Flysystem v1, this package is for Flysystem v2
2. [`lustmored/flysystem-v2-simple-cache-adapter`](https://github.com/Lustmored/flysystem-v2-simple-cache-adapter)caches metadatas, this package focuses on caching file contents

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

Unknown

Total

1

Last Release

1625d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/50348?v=4)[Sahn Lam](/maintainers/Slam)[@slam](https://github.com/slam)

---

Top Contributors

[![Slamdunk](https://avatars.githubusercontent.com/u/152236?v=4)](https://github.com/Slamdunk "Slamdunk (9 commits)")

---

Tags

cacheflysystemflysystem-adapterphp

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/slam-flysystem-local-cache-proxy/health.svg)

```
[![Health](https://phpackages.com/badges/slam-flysystem-local-cache-proxy/health.svg)](https://phpackages.com/packages/slam-flysystem-local-cache-proxy)
```

###  Alternatives

[snc/redis-bundle

A Redis bundle for Symfony

1.0k39.4M67](/packages/snc-redis-bundle)[league/flysystem-cached-adapter

An adapter decorator to enable meta-data caching.

35426.9M119](/packages/league-flysystem-cached-adapter)[cache/cache

Library of all the php-cache adapters

2712.7M22](/packages/cache-cache)[illuminate/cache

The Illuminate Cache package.

12835.6M1.4k](/packages/illuminate-cache)[cache/filesystem-adapter

A PSR-6 cache implementation using filesystem. This implementation supports tags

705.8M82](/packages/cache-filesystem-adapter)[lustmored/flysystem-v2-simple-cache-adapter

Simple flysystem PSR cache adapter decorator.

16118.7k1](/packages/lustmored-flysystem-v2-simple-cache-adapter)

PHPackages © 2026

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