Cache

Posted Almost 10 years ago. Visible to the public. Draft.

Here is a quick rundown of cache initialisation, from the group up.

Mage::run() or Mage::app()

    Mage_Core_Model_App::init() or Mage_Core_Model_App::baseInit()

        Mage_Core_Model_App::_initCache();

            Mage_Core_Model_Cache::__construct()

                use _getBackendOptions() and _getFrontendOptions() to sanitise options

                use Zend_Cache::factory() to get frontend and backend:

                    frontend: Varien_Cache_Core
                    backend: Zend_Cache_Backend_File

When dealing with the cache, you interact with either the "System cache model", the frontend, or the backend.

Mage_Core_Model_App::getCacheInstance() gets the "System cache model" - it holds a reference to the cache frontend, deals with setting up the cache and configuring it, handles the different cache types, locking, and also some cache interaction such as invalidating and clearing by tags etc.

Mage_Core_Model_App::getCache() gets the frontend, which is Varien_Cache_Core (it extends Zend_Cache_Core).

Mage_Core_Model_App::getCacheInstance()->getBackend() gets the backend.

Mike Whitby
Last edit
Over 9 years ago
Mike Whitby
Posted by Mike Whitby to Magento (2014-05-15 12:51)