PHPackages                             mapsight/pulp-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. mapsight/pulp-cache

ActiveLibrary[Caching](/categories/caching)

mapsight/pulp-cache
===================

Cache handlers and sources for Pulp pipelines.

00PHP

Since Jun 18Pushed todayCompare

[ Source](https://github.com/open-mapsight/pulp-cache)[ Packagist](https://packagist.org/packages/mapsight/pulp-cache)[ RSS](/packages/mapsight-pulp-cache/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Pulp Cache
==========

[](#pulp-cache)

Generic caching helpers for Pulp pipelines.

Features
--------

[](#features)

- **Remember expensive sources:** Wrap any source pipeline and reuse cached output on fresh cache hits.
- **Pass-through caching:** Cache any file that flows through a pipeline, independent of where it came from.
- **Stale fallback:** Keep jobs working with the last cached result if an upstream source fails.
- **Multiple file support:** Cache and restore one or more Pulp `File` objects via a manifest.
- **Raw or serialized payloads:** String payloads are stored as raw files; decoded arrays/objects are serialized.

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

[](#installation)

```
composer require mapsight/pulp-cache
```

Remember a Source Pipeline
--------------------------

[](#remember-a-source-pipeline)

Use `remember()` when you want cache hits to skip an expensive upstream operation, such as a large HTTP download.

```
use OpenMapsight\Pulp;
use OpenMapsight\PulpCache;

$source = Pulp::start()
    ->pipe(Pulp::srcHttp(
        'GET',
        'https://example.com/data.zip',
        ['timeout' => 120],
        'data.zip'
    ));

$files = Pulp::start()
    ->pipe(PulpCache::remember($source, __DIR__ . '/cache', [
        'key' => 'example-data',
        'ttl' => 86400,
        'fallbackToStale' => true,
    ]))
    ->run();
```

On a fresh cache hit, the wrapped `$source` pipeline is not executed.

Cache Within a Pipeline
-----------------------

[](#cache-within-a-pipeline)

Use `cache()` as a regular pass-through handler when the upstream pipeline should still be part of the flow.

```
Pulp::start()
    ->pipe(Pulp::src('*.geojson', __DIR__ . '/input'))
    ->pipe(PulpCache::cache(__DIR__ . '/cache', [
        'ttl' => 3600,
    ]))
    ->pipe(Pulp::dest(__DIR__ . '/result'))
    ->run();
```

Options
-------

[](#options)

- `key` (`string`): Stable cache key. Defaults to `remember` for `remember()` and the current file name for `cache()`.
- `ttl` (`int`): Cache lifetime in seconds. Defaults to `86400`.
- `ttl < 0`: Cache never expires.
- `ttl = 0`: Always refresh/write the cache.
- `fallbackToStale` (`bool`): For `remember()`, return stale cached files if the wrapped source fails. Defaults to `true`.

Cache Layout
------------

[](#cache-layout)

Each cache key gets its own directory:

```
cache/
  example-data/
    manifest.json
    0000.zip
    0001.json

```

`manifest.json` stores the original Pulp file names, payload encoding, and cache file paths.

Notes
-----

[](#notes)

- Keep cache keys stable and independent of secrets.
- Do not use a public web directory as the cache directory if cached input contains private URLs, credentials, or paid data.
- `remember()` is best for source/subpipeline caching. `cache()` is best for caching an intermediate file in an already-running pipeline.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance65

Regular maintenance activity

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 66.7% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/684458?v=4)[Paul Golmann](/maintainers/pjeweb)[@pjeweb](https://github.com/pjeweb)

---

Top Contributors

[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")[![pjeweb](https://avatars.githubusercontent.com/u/684458?v=4)](https://github.com/pjeweb "pjeweb (1 commits)")

### Embed Badge

![Health badge](/badges/mapsight-pulp-cache/health.svg)

```
[![Health](https://phpackages.com/badges/mapsight-pulp-cache/health.svg)](https://phpackages.com/packages/mapsight-pulp-cache)
```

###  Alternatives

[barryvdh/laravel-httpcache

HttpCache for Laravel

513404.4k10](/packages/barryvdh-laravel-httpcache)[iron-io/iron_cache

Client binding for IronCache (A key/value store in the cloud)

1514.8k1](/packages/iron-io-iron-cache)

PHPackages © 2026

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