3

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 2

4

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
3
  • Media and CSS cache clear commands are: n98-magerun.phar media:cache:image:clear n98-magerun.phar media:cache:jscss:clear
    – cmuench
    Commented Jul 3, 2015 at 12:47
  • @cmuench: sure, that namespace prefix of the command was in the description. I made this more clear now.
    – hakre
    Commented 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
1

To flush cache using MageRun:

magerun cache:clean && magerun cache:flush
3
  • from the top of my head: If you run cache:flush you won't need to run cache:clean. the commad you name flushes all caches at once.
    – hakre
    Commented Jul 3, 2015 at 13:36
  • Do we need to install magerun? i get magerun: command not found
    – Sushivam
    Commented Oct 27, 2016 at 6:14
  • yeah you need to run the magerun command: files.magerun.net
    – MagePsycho
    Commented Jul 3, 2017 at 15:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.