While learning about the diverse caches in Magento (e.g. per Various Magento Cache flushing methods, I was wondering which of these Magerun supports on how the commands would look like?
2 Answers
Magerun supports differentiated cache handling from the command-line:
Flush and refresh:
Magerun supports both to flush (empty the cache) or refresh (cleaning the invalidated cache keys) the cache(s).
The wording is flush
to flush/empty the cache and clean
to refresh/clean.
Next to flushing and refreshing the cache, caches can be en- and disabled, listed, viewed, reported and there is a whole suite for benchmarking the caches. All those commands are under the cache:
namespace.
Example:
user@host ~$ n98-magerun.phar cache:clean
block_html cache cleaned
collections cache cleaned
config cache cleaned
config_api cache cleaned
config_api2 cache cleaned
config_monitoring cache cleaned
eav cache cleaned
ecomdev_phpunit cache cleaned
factfinder_search cache cleaned
full_page cache cleaned
layout cache cleaned
translate cache cleaned
CSS/Javascript cache:
As the CSS and Javascript cache is handled separately in Magento, Magerun has it as part of the media:cache:
namespace. Both CSS/Javascript as well as the images cache can be cleared:
media:cache:image:clear
media:cache:jscss:clear
-
Media and CSS cache clear commands are:
n98-magerun.phar media:cache:image:clear
n98-magerun.phar media:cache:jscss:clear
– cmuenchCommented Jul 3, 2015 at 12:47 -
@cmuench: sure, that namespace prefix of the command was in the description. I made this more clear now.– hakreCommented Jul 3, 2015 at 13:37
-
With
n98-magerun.phar media:cache:image:clear
I get:[InvalidArgumentException] There are no commands defined in the "media:cache:image" namespace.
Commented Jul 5, 2017 at 8:01
To flush cache using MageRun:
magerun cache:clean && magerun cache:flush
-
from the top of my head: If you run
cache:flush
you won't need to runcache:clean
. the commad you name flushes all caches at once.– hakreCommented Jul 3, 2015 at 13:36 -
Do we need to install magerun? i get magerun: command not found– SushivamCommented Oct 27, 2016 at 6:14
-
yeah you need to run the magerun command: files.magerun.net Commented Jul 3, 2017 at 15:31