Static cache how to exclude class #8553
Answered
by
jasonvarga
earthwytch
asked this question in
Q&A
-
In the
Is this an option I could use to exclude all pages with forms on them, so I don't have to individually add each form url? Statamic v4.16.0 |
Beta Was this translation helpful? Give feedback.
Answered by
jasonvarga
Aug 9, 2023
Replies: 1 comment 3 replies
-
You can create a class that implements 'exclude' => [
'class' => \App\MyUrlExcluder::class,
], <?php
namespace App;
use Statamic\StaticCaching\UrlExcluder;
class MyUrlExcluder implements UrlExcluder
{
public function isExcluded(string $url): bool
{
// Your logic to figure out whether the url should be excluded.
return false;
}
} That's how you'd use a custom class. However, I'm not sure how you'd be able to magically check "if the page has a form on it". 🤔 |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
earthwytch
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can create a class that implements
Statamic\StaticCaching\UrlExcluder
then point to it there.That's how you'd use a custom class. However, I'm not sure how you'd be able to magically check "if the page has a form on it". 🤔