Clearing cache from the shell

Magento often needs to refresh it's cache. In some occasion, you may want to flush either partialy or completly from the shell.

This is how you may acheive this task:
php ~/www/shell/cleanCache.php --clean <your cache>

The full list of possibilities:
Usage:  php ~/www/shell/cleanCache.php -- [options]

    --clean <cache>          Clean <cache>. Any of [image|data|stored|js_css|files]
    all                      Clean all caches
    info                     Show allowed caches
    help                     This help
To get an easy list of the different caches:
php ~/www/shell/cleanCache.php info
Allowed caches:
 image
 data
 stored
 js_css
 files


Examples

  • Clean ALL
    php ~/www/shell/cleanCache.php all

  • Clean the configuration, layout...
    php ~/www/shell/cleanCache.php --clean data

  • Clean the front end styling...
    php ~/www/shell/cleanCache.php --clean js_css



The github link to the script:
https://raw.githubusercontent.com/machampagne/magento-utils/master/shell/cleanCache.php

  • 8 gebruikers vonden dit artikel nuttig
Was dit antwoord nuttig?

Gerelateerde artikelen

How to add and edit attribute sets in Magento

Each product that you add in Magento can be configured thanks to a set of attributes. These are...

How to add and edit search terms in Magento

Magento has a search function that customers can use to look for products on the frontend of your...

Magento Version

You may want to know wich version of Magento that you are running.  An easy way to do it is from...

Why is Magento cron job not working?

cPanel + CageFS and CloudLinux's PHP switcher may cause problems with Magento CRON. Until this is...

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2828-148-1-471' for key 'PRIMARY'

While trying to reindex your store using the command line, you stumble on the following...