Install Redis Caching for Magento

From Brian Nelson Ramblings
Revision as of 15:40, 24 December 2013 by Brian (Talk | contribs) (2) Install Cm_Cache_Backend_Redis Magento Extension)

Jump to: navigation, search

Install Redis Caching for Magento

How to install redis for backend caching? You see alot of talk about using apc and memcached for Magento caching, but if you are looking for a more stable caching, then redis is for you.

1) Install Redis and phpRedis

This can be done using yum, which makes this step pretty easy.

yum install redis php-pecl-redis
service redis start
chkconfig redis on

Now to verify that redis is chkconfig on

chkconfig --list redis

2) Install Cm_Cache_Backend_Redis Magento Extension

This is the extension that is required on versions of CE 1.7.0.2 and older, as Magento 1.8.0.0 it comes pre installed.

wget -O Cm_Cache_Backend_Redis.tar.gz https://github.com/colinmollenhour/Cm_Cache_Backend_Redis/tarball/master
tar xzf Cm_Cache_Backend_Redis.tar.gz 
cd colinmollenhour-Cm_Cache_Backend_Redis-9bd58d2/
cp Cm_Cache_Backend_Redis/Cm /path/to/magento/app/code/local/
cp Cm_Cache_Backend_Redis/lib/Credis /path/to/magento/lib/
cat > /path/to/magento/app/etc/modules/Cm_Cache.xml <<eof
<?xml version="1.0" encoding="UTF-8"?>
<config>
   <modules>
       <Cm_Cache>
           <active>true</active>
           <codePool>local</codePool>
       </Cm_Cache>
   </modules>
</config>
eof

3) Install

4) Configure Magento to use Redis