Need help buying now? +48-22-219-5163 +1-917-720-3250
My Cart

Your Cart is Empty

Need help buying now?
+48-22-219-5163 +1-917-720-3250

Magento cache

In order to increase the volume of visits on your site, it is very important to optimize it. Caching plays a good role in this process. Let us review how to flush Magento cache. Also it should be mentioned that you can find many Magento modules for the cache work.

General information

You may learn more information about the available ways to caching in Magento (apc /memcached /xcache /file) here:

The cache function is used to store the history of web site visits. Any internet browser used at this time automatically stores all data about visited sites, requests, etc, in a special folder on the hard drive. This makes the ‘computer – web’ operation and pages loading much faster.

This is how browser caches the information. But Magento cache works in a slightly different way. MagentoCache is a tool that caches specific pages, page blocks, database requests, etc. This information is stored on the server (not on the local PC of the site visitor) and, when a query is done again, Magento does not create the data anew but takes it from cache.

In other words, when you access a specific site using an internet browser, it stores the information received from that site in its cache; if then you close it, open again and access the same site, now the browser will not use traffic to load the whole page, but will take a cached copy and check if there have been any changes on the actual page compared to the cached information, and due to this the web page will be loaded faster than for the first time.

The cache function in Magento helps to make the process of products loading in the store faster, which attracts users and potential customers. But the main peculiarity of this Magento option is that, if you change the product category, description, add new products, etc, make any changes in your store, then you will need to refresh your Magento cache in order for your store to be displayed properly by the end users’ browsers.

There are several ways to flush Magento cache, the easiest one is to simply refresh it using your admin panel. But, if you have a module of web site integration with other systems, e.g. with search engines, shopping systems, etc,. then this is not the best variant as the information need to be updated for those systems as well. In this case you will need to modify some .php files, or create a new one that will automatically enable the cache refreshing.

You may use the following script for flushing your store cache:

/*enable app/Mage.php*/
    require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR. 'app' . 
DIRECTORY_SEPARATOR . 'Mage.php'; $app = Mage::app('admin', 'store'); if($app->cleanCache()) { Mage::log("Successfully was cleared the cache."); //echo 'Successfully was cleared the cache.'; } else { Mage::log("An error occurred while flushing the cache."); //echo 'An error occurred while flushing the cache.'; }


Code receipt taken from

This file should be located in shell/cacheRefresh.php folder and the cache flushing interval should be specified, e.g. every hour or every day.

After that flushing and refreshing of Magento Cache will be done automatically according to the time interval you specify.

If you have any questions related to Magento cache functionality, please feel free to contact GoMage magento experts using our forum or leaving a comment to this article.