Posted almost 8 years ago. Visible to the public.

Cache Clearing And General Information

Clean everything (use either):

Mage::app()->getCacheInstance()->flush(); Mage::app()->getCache()->clean();

Clean specific types:

Mage::app()->getCacheInstance()->cleanType('config'); Mage::app()->getCacheInstance()->cleanType('layout'); Mage::app()->getCacheInstance()->cleanType('block_html'); Mage::app()->getCacheInstance()->cleanType('translate'); Mage::app()->getCacheInstance()->cleanType('collections'); Mage::app()->getCacheInstance()->cleanType('eav'); Mage::app()->getCacheInstance()->cleanType('config_api'); Enterprise_PageCache_Model_Cache::getCacheInstance()->cleanType('full_page');

Get all declared cache types:

Cache Types

Each cache has it's own type id, which is a Magento concept to aid management of
each type of cache, basically you would use the type id to clear by that type.
Each type corresponds to a tag or a set of tags which will be cleaned when you
clean that type. To find out the info for all the currently declared types use
the "Get all declared cache types" snippet above and var_dump() it.

All cache types are stored in config, in the path global/cache/types, so you
could also use something like the Magento Debug Toolbar to
inspect the config stored at that path.


Type ID: config Tags: CONFIG



Blocks HTML output

Type ID: block_html Tags: BLOCK_HTML


Type ID: translate Tags: TRANSLATE

Collections Data

Type ID: collections Tags: COLLECTION_DATA

EAV types and attributes

Type ID: eav Tags: EAV

Web Services Configuration

Type ID: config_api Tags: CONFIG_API

(Full) Page Cache

Type ID: full_page Tags: FPC

Note - full page cache is normally kept in a seperate cache backend, so you
should use it's own cache manager to reliably clear it

Owner of this card:

Mike Whitby
Last edit:
about 5 years ago
by Mike Whitby
Posted by Mike Whitby to Magento
This website uses cookies to improve usability and analyze traffic.
Accept or learn more