PHPackages                             f\_roepstorf/static-cache-buster - 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. f\_roepstorf/static-cache-buster

ActiveStatamic-addon[Caching](/categories/caching)

f\_roepstorf/static-cache-buster
================================

Warm the Statamic static cache without causing cache misses for visitors

v1.0.2(10mo ago)01.3k↓33.3%MITPHPCI failing

Since Apr 24Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/FRoepstorf/static-cache-buster)[ Packagist](https://packagist.org/packages/f_roepstorf/static-cache-buster)[ RSS](/packages/f-roepstorf-static-cache-buster/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (6)Versions (4)Used By (0)

Static Cache Buster for Statamic
================================

[](#static-cache-buster-for-statamic)

This addon enhances Statamic's static caching by allowing you to safely rebuild and swap the static cache without serving stale content during the build process.

How It Works
------------

[](#how-it-works)

The addon extends Statamic's FileCacher to recognize a special header (`X-Statamic-Cache-Buster`) that signals when a request is coming from the cache warming process. When this header is detected, the cacher will ignore any existing cached content and generate fresh content instead.

This ensures that visitors always get a cached response when rebuilding the cache

It is also very handy, when you use multiple nested components to render pages: It can be difficult to track which pages are using the components, and which ones are not.

Requirements
------------

[](#requirements)

- Statamic 5.x
- PHP 8.1 or higher(might work with lower versions)
- Static caching must be enabled and configured to use the file driver

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

[](#installation)

```
composer require f_roepstorf/static-cache-buster
```

For production environments, it's recommended to install with the `--prefer-dist` flag:

```
composer require f_roepstorf/static-cache-buster --prefer-dist
```

This ensures only the necessary files are installed, excluding development files like tests and configuration.

Usage
-----

[](#usage)

Run the cache buster command:

```
php artisan cache-buster:warm
```

### Options

[](#options)

The command supports various options:

- `--queue`: Queue the requests instead of processing them synchronously
- `--user=`: HTTP authentication user
- `--password=`: HTTP authentication password
- `--insecure`: Skip SSL verification
- `--uncached`: Only warm URLs that aren't currently cached
- `--max-depth=`: Maximum depth of URLs to warm
- `--include=`: Only warm specific URLs
- `--exclude=`: Exclude specific URLs
- `--max-requests=`: Maximum number of requests to warm

Nginx Configuration
-------------------

[](#nginx-configuration)

If you're using Nginx with the default Statamic static caching setup, you'll need to add the following to your server configuration to properly handle the cache buster header:

```
set $try_location @static;

if ($request_method != GET) {
    set $try_location @not_static;
}

if ($args ~* "live-preview=(.*)") {
    set $try_location @not_static;
}

# Skip static cache when cache buster header is present
if ($http_x_statamic_cache_buster = "true") {
    set $try_location @not_static;
}

location / {
    try_files $uri $try_location;
}

location @static {
    try_files /static/${host}${uri}_$args.html $uri $uri/ /index.php?$args;
}

location @not_static {
    try_files $uri /index.php?$args;
}
```

This configuration ensures that requests with the `X-Statamic-Cache-Buster` header bypass the static cache and pass through to PHP.

License
-------

[](#license)

This addon is open-source software licensed under the MIT license.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance53

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

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

Total

3

Last Release

327d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d8d92713d07e2cada3d186b0cd17d963ff21a952934d0e3bdd04820867f73d6?d=identicon)[froepstorf](/maintainers/froepstorf)

---

Top Contributors

[![FlorianRiquelme](https://avatars.githubusercontent.com/u/13087909?v=4)](https://github.com/FlorianRiquelme "FlorianRiquelme (1 commits)")

###  Code Quality

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/f-roepstorf-static-cache-buster/health.svg)

```
[![Health](https://phpackages.com/badges/f-roepstorf-static-cache-buster/health.svg)](https://phpackages.com/packages/f-roepstorf-static-cache-buster)
```

###  Alternatives

[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)[illuminate/cache

The Illuminate Cache package.

12835.6M1.4k](/packages/illuminate-cache)[colinmollenhour/php-redis-session-abstract

A Redis-based session handler with optimistic locking

6325.6M14](/packages/colinmollenhour-php-redis-session-abstract)[amphp/redis

Efficient asynchronous communication with Redis servers, enabling scalable and responsive data storage and retrieval.

165634.7k44](/packages/amphp-redis)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)[elcobvg/laravel-opcache

Custom OPcache Cache Driver for Laravel. Faster than Redis or memcached.

43317.1k1](/packages/elcobvg-laravel-opcache)

PHPackages © 2026

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