Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/Http/Controllers/CP/Utilities/CacheController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Statamic\Facades\URL;
use Statamic\Http\Controllers\CP\CpController;
use Statamic\StaticCaching\Cacher;
use Statamic\StaticCaching\Cachers\AbstractCacher;
use Statamic\Support\Str;

use function Statamic\trans as __;
Expand Down Expand Up @@ -75,11 +76,16 @@ protected function getImageCacheStats()
protected function getStaticCacheStats()
{
$strategy = config('statamic.static_caching.strategy');
$cacher = StaticCache::driver();

$count = $cacher instanceof AbstractCacher
? $cacher->getDomains()->sum(fn ($domain) => $cacher->getUrls($domain)->count())
: $cacher->getUrls()->count();

return [
'enabled' => (bool) $strategy,
'strategy' => $strategy ?? __('Disabled'),
'count' => StaticCache::driver()->getUrls()->count(),
'count' => $count,
];
}

Expand Down
Loading