craft-blitz
craft-blitz copied to clipboard
Possibility to disable automatic cache purging/invalidation on resave
Support Request
I'm looking into ways to disable the automatic cache purging by Cloudfront on entry resave. I'd like to have more manual control (hourly cache builds & purges for example) to be able to manage Cloudfront costs better. I'd love to run the build process from the CLI or from the Blitz dashboard still.
Was looking into some of the existing hooks but none of them seems to really help me, closest one I could find was:
Event::on(RefreshCacheService::class, RefreshCacheService::EVENT_BEFORE_ADD_ELEMENT,
function(RefreshElementEvent $event) {
Blitz::$plugin->log('Cache purge blocked from resave');
$event->isValid = false;
}
);
But this just prevents the cache from being saved to the DB as well.
Plugin Version
4.18.2