PHPackages                             nepada/bust-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. nepada/bust-cache

ActiveLibrary[Caching](/categories/caching)

nepada/bust-cache
=================

Cache busting Latte tag.

v3.1.3(5mo ago)515.4k↓25%1BSD-3-ClausePHPPHP &gt;=8.1.0 &lt;8.6CI passing

Since Feb 23Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/nepada/bust-cache)[ Packagist](https://packagist.org/packages/nepada/bust-cache)[ RSS](/packages/nepada-bust-cache/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (17)Versions (26)Used By (0)

Bust Cache Latte Tag
====================

[](#bust-cache-latte-tag)

[![Build Status](https://github.com/nepada/bust-cache/workflows/CI/badge.svg)](https://github.com/nepada/bust-cache/actions?query=workflow%3ACI+branch%3Amaster)[![Coverage Status](https://camo.githubusercontent.com/fb63795076ad77810dc66d51b0d1a9f457315ca439c356fe33c36bfaaf16ade5/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6e65706164612f627573742d63616368652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/nepada/bust-cache?branch=master)[![Downloads this Month](https://camo.githubusercontent.com/255ee31535d9453e9416f57cd184a7e9c95d3f35c54759c01c757ac9a3bad0da/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6e65706164612f627573742d63616368652e737667)](https://packagist.org/packages/nepada/bust-cache)[![Latest stable](https://camo.githubusercontent.com/574f5b26d1dfe8dccd9c6f7a1cf5614c1ebff1a9bbca611fc8a7552d80fd1347/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e65706164612f627573742d63616368652e737667)](https://packagist.org/packages/nepada/bust-cache)

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

[](#installation)

Via Composer:

```
$ composer require nepada/bust-cache
```

Register the extension in `config.neon`:

```
extensions:
    bustCache: Nepada\Bridges\BustCacheDI\BustCacheExtension(%wwwDir%, %debugMode%)
```

Overview of available configuration options with their default values:

```
bustCache:
  strategy: contentHash # modificationTime in debugMode
  autoRefresh: %debugMode%
  manifest: true
  strictMode: false
```

If you're using stand-alone Latte, install the Latte extension manually:

```
$fileSystem = Nepada\BustCache\LocalFileSystem::forDirectory($wwwDir);
$manifestFinder = new Nepada\BustCache\Manifest\AutodetectManifestFinder($fileSystem);
$revisionFinder = new Nepada\BustCache\Manifest\DefaultRevisionFinder($fileSystem, $manifestFinder);
$cache = new Nepada\BustCache\Caching\NullCache(); // or other implementation of Cache
$strategy = new Nepada\BustCache\CacheBustingStrategies\ContentHash(); // or other strategy
$pathProcessor = new Nepada\BustCache\BustCachePathProcessor($fileSystem, $cache, $revisionFinder, $strategy);
$latte->addExtension(new Nepada\Bridges\BustCacheLatte\BustCacheLatteExtension($pathProcessor, $strictMode, $autoRefresh));
```

Usage
-----

[](#usage)

Basic example:

```

```

The resulting path depends on the (auto-)chosen cache busting strategy:

```

```

Usage in application with non-trivial base path:

```

```

Generating full absolute URL:

```

```

### Revision manifest support

[](#revision-manifest-support)

Revision manifest is a JSON file that contains mapping between original asset path and its revision path.

Example:

```
{
    "css/style.css": "css/style-30cc681d44.css",
    "js/app.js": "js/app-68130ccd44.js"
}
```

#### Configuration

[](#configuration)

With default configuration the path of manifest file is auto-detected by traversing up from asset directory and looking for `manifest.json` or `rev-manifest.json`. If a manifest file is found, the contained revision mapping is used instead of cache busting using query parameter.

You can completely disable the revision manifest support by setting `manifest: false` in your config.

You can also bypass the auto-detection and specify the manifest file path statically, e.g. `manifest: "assets/my-manifest.json"`

### Caching

[](#caching)

The caching is implemented on two levels - runtime and compile-time.

#### Runtime caching

[](#runtime-caching)

The cache stores the computed cache busted path for each input path.

DI extension automatically enables this cache, if you have `nette/caching` configured. In production mode with default settings, asset files are not checked for modification to avoid unnecessary I/O, i.e. the cache is not automatically refreshed.

#### Compile time caching

[](#compile-time-caching)

When the file path is specified as literal string, the cache busted path is computed in compile time of Latte template and the cache busted path is directly dumped into the compiled code of template.

With the default settings, this is enabled only in production mode.

#### Cache busting of files that are modified in app runtime

[](#cache-busting-of-files-that-are-modified-in-app-runtime)

If you want to use cache busting on files that are expected to be modified in app runtime, you can use `dynamic` keyword to opt-out of compile time caching and force auto refresh of cache even in production mode:

```

```

### Handling of missing manifest or asset files

[](#handling-of-missing-manifest-or-asset-files)

With default configuration, when a missing file (manifest or asset) is encountered a warning triggered and asset dummy path is generated. You can switch to `strictMode: true` to fail hard by throwing exception instead.

"Missing file" is one of the following cases:

- the static manifest file specified in configuration does not exist
- a manifest file points to a revision path that does not exist
- using cache busting by query parameter with asset path that does not exist

###  Health Score

59

—

FairBetter than 99% of packages

Maintenance81

Actively maintained with recent releases

Popularity31

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity91

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 57.6% 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 ~178 days

Recently: every ~288 days

Total

21

Last Release

176d ago

Major Versions

v1.1.1 → v2.0.02018-06-26

v2.4.1 → v3.0.02022-07-28

PHP version history (10 changes)v1.0.0PHP &gt;= 5.6.0

v1.1.0PHP &gt;=7.1.0

v2.2.0PHP &gt;=7.2.0

v2.3.0PHP &gt;=7.4.0

v2.4.1PHP &gt;=7.4.0 &lt;8.2

v3.0.0PHP &gt;=8.0.0 &lt;8.2

v3.0.2PHP &gt;=8.0.0 &lt;8.3

v3.1.0PHP &gt;=8.1.0 &lt;8.4

v3.1.1PHP &gt;=8.1.0 &lt;8.5

v3.1.3PHP &gt;=8.1.0 &lt;8.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b4780fe328102c4572737db639653c29d3081d1d3e051467f00d7f09a776399?d=identicon)[xificurk](/maintainers/xificurk)

---

Top Contributors

[![xificurk](https://avatars.githubusercontent.com/u/117465?v=4)](https://github.com/xificurk "xificurk (193 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (141 commits)")[![lachmart](https://avatars.githubusercontent.com/u/7383506?v=4)](https://github.com/lachmart "lachmart (1 commits)")

---

Tags

nettecachelattebust

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nepada-bust-cache/health.svg)

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

###  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)[kdyby/redis

Redis storage for Nette Framework

491.6M2](/packages/kdyby-redis)[contributte/redis

Redis client integration into Nette framework

181.6M2](/packages/contributte-redis)[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)

PHPackages © 2026

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