cli icon indicating copy to clipboard operation
cli copied to clipboard

Allow clear:cache to clear all caches at once

Open MoritzLost opened this issue 3 years ago • 1 comments

The clear:cache prompts for the name for the cache to clear and defaults to the pages cache. However, there's no way to just clear all caches at once. This would be great to have – for example, to clear all existing caches in a deployment script.

Beyond that, as far as I can tell, the command can only clear caches under cache/[domain]/. For example, kirby clear:cache pages clears the cache/[domain]/pages folder. Is it possible to have the command clear caches that live in the cache/ directory? The Twig plugin stores the compilation cache under cache/twig, but calling kirby clear:cache twig doesn't clear it out.

MoritzLost avatar Dec 09 '22 14:12 MoritzLost

Since custom cache folders cannot be called with the $kiby->cache() method, it makes sense to remove the /cache/domain folder when all is selected.

I would also prefer the default to be all instead of pages, so if propmt is left empty the entire /cache/domain folder should be deleted. But this includes breaking change.

afbora avatar Feb 22 '24 14:02 afbora