diff --git a/app/Caching/CacheInvalidator.php b/app/Caching/CacheInvalidator.php index 9a574b3..73f14cc 100644 --- a/app/Caching/CacheInvalidator.php +++ b/app/Caching/CacheInvalidator.php @@ -43,6 +43,15 @@ public function invalidate($item) if ($urls instanceof Collection) { $this->cacher->invalidateUrls($urls->all()); + + // sometimes if you clear artisan cache, the static cache is out of sync + // this gets around that + $urls->each(function ($url) { + $file = $this->cacher->getFilePath($url); + if (file_exists($file)) { + unlink($file); + } + }); } }