简体   繁体   English

带有memcached的magento整页缓存

[英]magento full page cache with memcached

I am trying to get Magento's full page cache using memcached. 我试图使用memcached获取Magento的整页缓存。

I understand that there is some configuration that needs to be set in the app/etc/enterprise.xml file, but there doesn't appear to be any documentation anywhere giving specific details of what this configuration should be. 我知道有一些配置需要在app / etc / enterprise.xml文件中设置,但似乎没有任何文档可以提供有关此配置的具体细节。

From what I've read, it is similar to the memcached config in app/etc/local.xml but not quite the same. 从我读过的内容来看,它类似于app / etc / local.xml中的memcached配置,但不完全相同。

Does anyone have this working who would be able to provide the appropriate configuration settings? 是否有人能够提供适当的配置设置?

Full Page Cache can be enabled in your cache management page in the admin. 可以在管理员的缓存管理页面中启用整页缓存。 To save the full page cache into memcache you need the following configuration. 要将整页缓存保存到内存缓存中,您需要以下配置。 This XML can be found in app/etc/local.xml.additional and needs to be added to your normal local.xml . 这个XML可以在app/etc/local.xml.additional ,需要添加到普通的local.xml

Do mind that you want your FPC cache and sessions stored into a different memcached pool. 请注意,您希望将FPC缓存和会话存储到不同的memcached池中。 Otherwise flushing the memcache will also result in logging out all of your customers. 否则,刷新内存缓存也会导致您注销所有客户。 Flushing memcache can be done in the admin with the Flush Cache Storage . 可以使用Flush Cache Storage在管理员中完成Flush Cache Storage内存Flush Cache Storage

Obviously this is only the Magento side, you also need to configure and run memcache on your server. 显然这只是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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM