2

where do I add this redis code for it to work in my local.xml?

<cache> <backend>Cm_Cache</backend> <backend_options> <server>127.0.0.1</server> <port>6379</port> <persistent></persistent> <password></password> <force_standalone>0</force_standalone>
<connect_retries>1</connect_retries>
<read_timeout>10</read_timeout>
<automatic_cleaning_factor>0</automatic_cleaning_factor> <compress_data>1</compress_data>
<compress_tags>1</compress_tags>
<compress_threshold>20480</compress_threshold>
<compression_lib>gzip</compression_lib> <use_lua>0</use_lua> </backend_options> </cache>

here is my local.xml:

config global, are not showing but they are there.

`

    <install>
        <date><![CDATA[Thu, 13 Nov 2014 16:42:08 +0000]]></date>
    </install>
    <crypt>
        <key><![CDATA[**************************]]></key>
    </crypt>
    <disable_local_modules>false</disable_local_modules>
    <resources>
        <db>
            <table_prefix><![CDATA[]]></table_prefix>
        </db>
        <default_setup>
            <connection>
                <host><![CDATA[localhost]]></host>
                <username><![CDATA[appuser]]></username>
                <password><![CDATA[**********]]></password>
                <dbname><![CDATA[******]]></dbname>
                <initStatements><![CDATA[SET NAMES utf8]]></initStatements>
                <model><![CDATA[mysql4]]></model>
                <type><![CDATA[pdo_mysql]]></type>
                <pdoType><![CDATA[]]></pdoType>
                <active>1</active>
            </connection>
        </default_setup>
    </resources>
    <session_save><![CDATA[files]]></session_save>
</global>
<admin>
    <routers>
        <adminhtml>
            <args>
                <frontName><![CDATA[g******]]></frontName>
            </args>
        </adminhtml>
    </routers>
</admin>

`

0

1 Answer 1

2

You have to add redis configuration just after <global> tag. And your local.xml should looks like below mentioned code.

<config>
    <global>
        <cache>
          <backend>Cm_Cache_Backend_Redis</backend>
          <backend_options>
            <server>127.0.0.1</server>
            <port>6379</port>
            <persistent></persistent>
            <database>0</database>
            <password></password>
            <force_standalone>0</force_standalone>
            <connect_retries>1</connect_retries>
            <read_timeout>10</read_timeout>
            <automatic_cleaning_factor>0</automatic_cleaning_factor>
            <compress_data>1</compress_data>
            <compress_tags>1</compress_tags>
            <compress_threshold>20480</compress_threshold>
            <compression_lib>gzip</compression_lib>
            <use_lua>0</use_lua>
          </backend_options>
        </cache>
        <full_page_cache>
          <backend>Cm_Cache_Backend_Redis</backend>
          <backend_options>
            <server>127.0.0.1</server>
            <port>6379</port>
            <persistent></persistent>
            <database>1</database>
            <password></password>
            <force_standalone>0</force_standalone>
            <connect_retries>1</connect_retries>
            <lifetimelimit>57600</lifetimelimit>
            <compress_data>0</compress_data>
          </backend_options>
        </full_page_cache>
        <!--End caching-->
        <install>
        <date><![CDATA[Thu, 13 Nov 2014 16:42:08 +0000]]></date>
        </install>
        <crypt>
            <key><![CDATA[**************************]]></key>
        </crypt>
        <disable_local_modules>false</disable_local_modules>
        <resources>
            <db>
                <table_prefix><![CDATA[]]></table_prefix>
            </db>
            <default_setup>
                <connection>
                    <host><![CDATA[localhost]]></host>
                    <username><![CDATA[appuser]]></username>
                    <password><![CDATA[**********]]></password>
                    <dbname><![CDATA[******]]></dbname>
                    <initStatements><![CDATA[SET NAMES utf8]]></initStatements>
                    <model><![CDATA[mysql4]]></model>
                    <type><![CDATA[pdo_mysql]]></type>
                    <pdoType><![CDATA[]]></pdoType>
                    <active>1</active>
                </connection>
            </default_setup>
        </resources>
        <session_save><![CDATA[files]]></session_save>
    </global>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <frontName><![CDATA[g******]]></frontName>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>

For check redis is working with your setup.

Login with your terminal :

$redis-cli

Press enter and you should look like below mentioned

127.0.0.1:6379>keys *

Press enter and you should see magento class names block name in caching.

Result should look something like attached screen shot.

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.