PHPackages                             tv2regionerne/statamic-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. tv2regionerne/statamic-cache

ActiveLibrary[Caching](/categories/caching)

tv2regionerne/statamic-cache
============================

229PHP

Since Feb 26Pushed 1y ago4 watchersCompare

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

READMEChangelogDependenciesVersions (22)Used By (0)

Statamic Autocache
==================

[](#statamic-autocache)

> Statamic Autocache is an addon that automatically caches the content of any partials for a faster response time and selective invalidation

How to Install
--------------

[](#how-to-install)

Run the following command from your project root:

```
composer require tv2regionerne/statamic-cache
```

Then run the migrations:

```
php artisan migrate
```

You can also optionally publish the config:

```
php artisan vendor:publish --tag=statamic-cache-config
```

How to Use
----------

[](#how-to-use)

The addon should work automatically in most cases. It adds hooks to partial, nav and collection tags, as well as augmentation of entries and globals to determine what content is included in what partials. This data is then added to a database store that is used to determine what cached data should be invalidated at what times.

The default cache is used, or you can specify a cache store called `statamic_autocache` if you want to have more control over when it is cleared.

### Middleware

[](#middleware)

The autocache middleware will automatically be added to your `web` middleware stack. If you want to include it to other stacks simply add:

`\Tv2regionerne\StatamicCache\Http\Middleware\Autocache::class`

### Store

[](#store)

The addon comes with a Facade for interacting with the Store: `\Tv2regionerne\StatamicCache\Facades\Store`

If you want to add extra data to the store you can do so using in your AppServiceProvider, eg:

```
MyTag::hook('init', function () {
	Store::mergeTags(['my_tag:id']);
});
```

Make sure you also invalidate the tag in a listener:

```
Store::invalidateContent(['my_tag:id']);
```

### Custom cache driver with database index

[](#custom-cache-driver-with-database-index)

Run the migrations to add the static\_cache table.

This add-on will automatically add a `redis_with_database` cache driver to your Statamic install. To use it change the half measure static cache driver in `config/statamic/static_caching.php` to use `redis_with_database`, and ensure `statamic.static_caching.strategy` is set to `half`.

```
'half' => [
    'driver' => 'redis_with_database',
    'expiry' => null,
],
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

Top contributor holds 80% 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://www.gravatar.com/avatar/b9761a79e61f2d5b9d650510dfb3555da18daf38f027aa84012c937e397e39a7?d=identicon)[cboxdk](/maintainers/cboxdk)

---

Top Contributors

[![ryanmitchell](https://avatars.githubusercontent.com/u/51899?v=4)](https://github.com/ryanmitchell "ryanmitchell (60 commits)")[![sylvesterdamgaard](https://avatars.githubusercontent.com/u/2431914?v=4)](https://github.com/sylvesterdamgaard "sylvesterdamgaard (15 commits)")

### Embed Badge

![Health badge](/badges/tv2regionerne-statamic-cache/health.svg)

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

###  Alternatives

[predis/predis

A flexible and feature-complete Redis/Valkey client for PHP.

7.8k305.7M2.4k](/packages/predis-predis)[snc/redis-bundle

A Redis bundle for Symfony

1.0k39.4M67](/packages/snc-redis-bundle)[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)[wp-media/wp-rocket

Performance optimization plugin for WordPress

7431.3M3](/packages/wp-media-wp-rocket)[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)

PHPackages © 2026

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