【问题标题】:magento full page cache with memcached带有memcached的magento全页缓存
【发布时间】:2012-08-06 22:57:53
【问题描述】:

我正在尝试使用 memcached 获取 Magento 的完整页面缓存。

我了解需要在 app/etc/enterprise.xml 文件中设置一些配置,但似乎没有任何文档提供该配置的具体细节。

根据我的阅读,它类似于 app/etc/local.xml 中的 memcached 配置,但并不完全相同。

有没有人能够提供适当的配置设置?

【问题讨论】:

  • 老兄,你有 EE ,请向企业支持寻求帮助,反正你为此付出了一大笔钱 :)
  • This article 关于 Magento 中的缓存应该链接到更多。

标签: magento memcached


【解决方案1】:

可以在管理员的缓存管理页面中启用整页缓存。要将整个页面缓存保存到 memcache 中,您需要以下配置。此 XML 可以在 app/etc/local.xml.additional 中找到,需要添加到您的普通 local.xml

请注意,您希望将 FPC 缓存和会话存储到不同的 memcached 池中。否则刷新内存缓存也将导致注销所有客户。刷新内存缓存可以在管理员中使用Flush Cache Storage 完成。

显然这只是 Magento 端,你还需要在你的服务器上配置和运行 memcache。

<config>
<global>
    <session_save><![CDATA[]]></session_save> <!-- db / memcache / empty=files -->
    <session_save_path><![CDATA[]]></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[]]></session_cache_limiter><!-- see http://php.net/manual/en/function.session-cache-limiter.php#82174 for possible values -->
    <cache>
        <backend></backend><!-- apc / memcached / xcache / empty=file -->
        <slow_backend></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></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[]]></host>
                    <port><![CDATA[]]></port>
                    <persistent><![CDATA[]]></persistent>
                    <weight><![CDATA[]]></weight>
                    <timeout><![CDATA[]]></timeout>
                    <retry_interval><![CDATA[]]></retry_interval>
                    <status><![CDATA[]]></status>
                </server>
            </servers>
            <compression><![CDATA[0]]></compression>
            <cache_dir><![CDATA[]]></cache_dir>
            <hashed_directory_level><![CDATA[]]></hashed_directory_level>
            <hashed_directory_umask><![CDATA[]]></hashed_directory_umask>
            <file_name_prefix><![CDATA[]]></file_name_prefix>
        </memcached>
    </cache>

    <!-- example of two level cache setup with slow backend at files. -->
    <full_page_cache>
        <backend_options>
             <cache_dir>full_page_cache</cache_dir>
         </backend_options>
         <slow_backend_options>
             <hashed_directory_level>1</hashed_directory_level>
             <hashed_directory_umask>0777</hashed_directory_umask>
             <file_name_prefix>fpc</file_name_prefix>
             <cache_dir><![CDATA[full_page_cache]]></cache_dir>
         </slow_backend_options>
     </full_page_cache>

    <remote_addr_headers><!-- list headers that contain real client IP if webserver is behind a reverse proxy -->
        <header1>HTTP_X_REAL_IP</header1>
        <header2>HTTP_X_FORWARDED_FOR</header2>
    </remote_addr_headers>
</global>

【讨论】:

  • 这很有帮助,但是当将 memcached 用于 FPC 时,Magento 似乎无法使用缓存页面上的任一按钮清除缓存。
  • 正确配置后,Magento 将在缓存管理页面上使用“存储”按钮刷新 memcache。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-08-27
  • 1970-01-01
  • 1970-01-01
  • 2015-12-03
  • 2011-08-14
相关资源
最近更新 更多