Magento使用Memcache做缓存和Session

修改app/etc/local.xml如下关键部分
<config>
<global>
    ... ... 
    <session_save><![CDATA[memcache]]></session_save> <!-- db / memcache / empty=files -->
    <session_save_path><![CDATA[tcp://X.X.X.X:11211?persistent=1&weight=2&timeout=10&retry_interval=10]]></session_save_path><!-- e.g. for memcache session save handler tcp://10.0.0.1:11211?persistent=1&weight=2&timeout=10&retry_interval=10 -->
    <session_cache_limiter><![CDATA[private]]></session_cache_limiter>
    <!-- see http://php.net/manual/en/function.session-cache-limiter.php#82174 for possible values -->
    <cache>
        <backend>memcached</backend><!-- apc / memcached / xcache / empty=file -->
        <slow_backend>database</slow_backend><!-- database / file (default) - used for 2 levels cache setup, necessary for all shared memory storages -->
        <slow_backend_store_data></slow_backend_store_data> <!-- 1 / 0 (default) - used for 2 levels cache setup, sets whether store data in db slow cache backend -->
        <auto_refresh_fast_cache>1</auto_refresh_fast_cache> <!-- 1 / 0 (default) - used for 2 levels cache setup, sets whether refresh data in fast cache backend -->
        <memcached><!-- memcached cache backend related config -->
            <servers><!-- any number of server nodes can be included -->
                <server>
                    <host><![CDATA[X.X.X.X]]></host>
                    <port><![CDATA[11211]]></port>
                    <persistent><![CDATA[1]]></persistent>
                </server>
                <server>
                    <host><![CDATA[X.X.X.X]]></host>
                    <port><![CDATA[11211]]></port>
                    <persistent><![CDATA[1]]></persistent>
                </server>
            </servers>
        </memcached>
    </cache>
    ... ...
</global>

你可能感兴趣的:(memcache)