Closed bwlng closed 4 years ago
Hi Stephen,
this is not possible, however, there is PurgeEvent, which is not fired so far - I never had a real use case.
Something like this (once implemented) could work :
\Event::on(
\ostark\upper\Plugin::class,
\ostark\upper\Plugin::EVENT_BEFORE_PURGE,
function (\ostark\upper\events\PurgeEvent $event) {
$site = \Craft::$app->getSites()->getSiteById($event->element->siteId);
$purger = Plugin::getInstance()->getPurger();
$purger->domain = $site->baseUrl;
}
);
Do you want to provide a PR? Or is this requirement not so important ;-)?
Hi Oliver,
Thanks for that info. I will look into a PR and see how far I can take it 😉
Would you prefer Upper to fire the PurgeEvent and then folks with use cases like mine would listen for the event in their own module?
there is no Module required, you can listen directly from you config/app.php using a closure
@bwlng Is this still a requirement?
@ostark Yes, I haven’t had a chance to provide a PR, but hope to do so.
Is it possible to clear the cache for multiple Cloudflare zones/domains? I’m using Upper on a Craft install where each site has a different domain. Is there a way to configure multiple zoneIds or domains (such as an array with nested config options under
cloudflare
inconfig/upper.php
or arrays forzoneId
anddomain
)?