Skip to content

thisbythem/Statamic-relative_cache_buster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 

Repository files navigation

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!

About

Busting Statamic cache like I was born too.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages