cacheFactory = $cacheFactory; $this->jsCombiner = $JSCombiner; } public function getName() { return 'Clear frontend caches'; } public function run(IOutput $output) { try { $c = $this->cacheFactory->createDistributed('imagePath'); $c->clear(); $output->info('Image cache cleared'); $this->jsCombiner->resetCache(); $output->info('JS cache cleared'); } catch (\Exception $e) { $output->warning('Unable to clear the frontend cache'); } } }