How to configure Magento to use APC for improved performance

This knowledgebase explains how to configure your Magento (version 1.4* +) installation to use APC for improved performance. This article is relevant to customers on our Magento Hosting Plan (our Magneto optimised hosting environment), and does not cover configuring APC on a dedicated or VPS server. APC has already been installed, configured and highly optmised on these servers for our Magento customers.

There is a little confusion amongst developers as to how to use APC. It is true that APC will work automatically for your website, however, the Magento team have also developed extra caching mechanisms exclusively for Magento, by directly utilizing APC via the core api calls. It is this that we are configuring.

Navigate to your app/etc/local.xml.additional file and you will see that there is a <cache> element that allows you to specify which caching method to ue in the <backend> element. This can have either of the following values:</backend<>/cache>

* apc
* memcached
* xcache

The local.xml.additional file isn't loaded in the config so we need to add this to our local.xml file, just before the closing tag. Bee sure to enter a unique value for you domain in the >prefix> element. We recommend using your SFTP username or your domain name without the dots. It is very important that you use a unique prefix for each website, otherwise you'll get some major problems.<prefix>

 
 <cache>
             <backend>apc </backend>
              <prefix>YOURDOMAIN_ </prefix>
 </cache>

Note: Magento has a "two levels backend" - a fast level and a slow level. Basically, Magento will use the fast level if possible, and if there is no memory available via APC, it will revert to the slow level.

  • 10 Users Found This Useful
Was this answer helpful?

Related Articles

How to upgrade Magento 1.3 to 1.4.1.1

The Magento 1.3 to 1.4.1.1 upgrade is quite complex, as there are many changes to the database...

How do I make my Magento site temporarily unavailable (put into maintenance mode)?

There may be times when you need to perform an upgrade and don't want your website to be accessed...

How to disable compilation in Magento

In general, Create Hosting customers shouldn't need compilation enabled, since our Magento...

How to activate the Mobile HTML5 theme in Magento 1.7 (for Android, Blackberry, iPhone, iPod, Windows Mobile, etc)

Magento 1.7 comes with a new Mobile HTML5 theme out of the box. This should be compatible with...

How to fix broken or slow Sales Order Address editing via Magento Admin

We recently came upon an issue in a Magento 1.5* instance where any attempt to edit the customer...