Flushing the cache
Created 7 years ago by keevitajaHi! Is there an easy way to flush the cache when admin updates/creates/deletes something in the admin section?
If not, then how do i flush the cache, when admin modifies file/post/page/navigation including the repeaters and custom fields?
Thanks a lot for the help!
keevitaja
—
7 years ago
yeah, that is one option
\Event::listen('eloquent.saved: *', function($event) {
cache()->flush();
});
But it would be nicer to target a specific module(s).
@mattcdavis1 what happens to opcache_reset(); when opcache is not installed?
Listening for the eloquent saved event should capture most updates although not all (i have a ticket open for this here: https://github.com/pyrocms/pyrocms/issues/4300)
As far as clearing the cache, that's just something like the below (i use this when deploying new code):