使用 Redis 作為快取後端

Redis 配置:

  1. 安裝 redis(需要 2.4+)
  2. 安裝 phpredis
  3. 安裝 Magento 擴充套件 Cm_Cache_Backend_Redis(僅適用於 Magento 1.7 及以下版本)
  4. 編輯你的 app/etc/local.xml
<global>
  ...
  <cache>
    <backend>Cm_Cache_Backend_Redis</backend>
    <backend_options>
      <server>127.0.0.1</server> <!-- or absolute path to unix socket -->
      <port>6379</port>
      <persistent></persistent>
      <database>0</database>
      <password></password>
      <force_standalone>0</force_standalone>
      <connect_retries>1</connect_retries>
      <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> <!-- Supports gzip, lzf and snappy -->
    </backend_options>
  </cache>
  ... 
</global>