Busting Statamic cache like I was born too.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
relative_cache_buster
README.md

README.md

Statamic: Relative HTML Cache Buster

If you need to bust other page caches when you update a certain piece of content, then you've come to the right place.

Installation

Download the repo and drop the relative_cache_buster folder into your _add-ons directory. There's a yaml file for you to tell buster what to do.

Make sure that you have html caching enabled and your cache_length is set to on last modified or on cache update.

Configure

If the file your updating is a single file, simply use the page slug. The example below will bust the homepage when the about page is updated.

"about-us":
 - "page.md"

You can also use a directory pattern. In this example, when a blog entry is created or updated, the homepage and blog listing page will be busted.

"blog/*":
 - "blog/page.md"
 - "page.md"

API

If you need to bust some cache within your own add-on, there's a bustCache method for your busting pleasure. Pass in a filepath and you're good to go!

$this->addon->api('relative_cache_buster')->bustCache('/path/to/file.md');

Courtesy of @edalzell. Thanks Erin!

Feedback & Contribute

Feedback? Ideas? Need support? Email us at support@thisbythem.com or feel free to fork and pull request your heart out. Happy hacking!