gpt4 book ai didi

caching - 如何在负载平衡的 Magento 环境中刷新缓存

转载 作者:行者123 更新时间:2023-12-02 17:13:28 26 4
gpt4 key购买 nike

我们有 2 台在负载均衡器后面运行 Magento 的服务器。当管理区域中的内容发生更改时,Magento 会提示我们刷新缓存。如果管理员用户连接到 www1 并运行缓存刷新,我们如何设置以便 www2 上的缓存也被刷新?有人处理过这个问题吗?

我们愿意安装 Memcached 并将其与 Magento 一起使用,但从我读到的内容来看,它似乎并没有完全取代文件系统缓存,因此我们仍然需要解决这个问题。如果这个假设是错误的,请纠正我,因为我想切换到 Memcached 可以解决这个问题。

最佳答案

我建议设置 memcached 甚至 varnish(似乎是新热潮),因为两者都可以简化您将两台服务器作为文件系统运行时遇到的负载平衡缓存和 session 共享问题。

引用 magebase 文章(注意:这同样适用于缓存):

Memcached session storage takes a bit more setup than either of the previous two options, which is probably why it’s not considered a ‘normal’ option during Magento install. For starters you need a Memcached server running.

Once you have it up and running, the memcached session storage offers a number of benefits. Firstly it is very cluster friendly. The session data can be shared by any number of webnodes, and to make things even better you can easily add more memcached server nodes so that even your session storage can be scaled to handle many 1000′s of concurrent sessions*. Secondly, it is (or can be) separate of the database and web node entirely, which offloads the work of storing sessions from busy nodes in a high-traffic environment.

有关为 Magento 选择 session 存储的更多详细信息:

http://magebase.com/magento-tutorials/magento-session-storage-which-to-choose-and-why/

有关设置 Varnish 以与 Magento 配合使用的更多详细信息:

Getting Varnish To Work on Magento

关于caching - 如何在负载平衡的 Magento 环境中刷新缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6736724/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com