Skip to content

Conversation

@duncanmcclean
Copy link
Member

This pull request adds the ability to invalidate specific URLs in the static cache via the Cache Manager utility. Essentially sherlocking my Static Cache Manager addon.

CleanShot.2025-11-27.at.12.50.48.mp4

You can even use * to specify a wildcard, like you can with invalidation rules.

Copy link
Member

@jasonvarga jasonvarga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "Clear All" button is now broken because the methods want the request but it doesn't pass them in.

When you choose "Invalidate specific URLs" but don't type anything, it flushes the whole static cache. That's a bit awkward. You should rather invalidate nothing than everything.

Maybe now's a good time to make individual routes rather than the wildcard route.

$router->post('cache/{cache}', [CacheController::class, 'clear'])->name('clear');

It would be better to have statamic.cp.utilities.cache.clear-all, .clear-static, clear-static-urls, .clear-stache, etc and update them here:
'clearAllUrl' => cp_route('utilities.cache.clear', 'all'),
'clearStacheUrl' => cp_route('utilities.cache.clear', 'stache'),
'warmStacheUrl' => cp_route('utilities.cache.warm', 'stache'),
'clearStaticUrl' => cp_route('utilities.cache.clear', 'static'),
'clearApplicationUrl' => cp_route('utilities.cache.clear', 'application'),
'clearImageUrl' => cp_route('utilities.cache.clear', 'image'),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants