I am currently trying to set up a production environment for Magento with the following setup:
2x web server, 1x DB server, load balancer.
Thus, the load balancer will distribute the traffic between the web servers, but will not use sticky sessions.
To solve the problem of sharing sessions between servers, I decided to use Memcached. I have a Memcached server running on each web server, and then listed the memcached servers in the local.xml file on each web server.
The cache works, as I definitely notice an increase in speed, and I see that sessions are shared between web servers. The problem is that the cache is working too well. Dynamic parts of the page (such as cart and messages) are fully cached for each page.
I noticed that getChildHtml (), which you call to place the cart on the page, has an optional parameter called useCache, which I explicitly pass to false, but that does nothing. Here is my definition of local.xml just in case I did something wrong (confidential information was left):
<config> <global> <install> <date></date> </install> <crypt> <key></key> </crypt> <disable_local_modules>false</disable_local_modules> <resources> <db> <table_prefix></table_prefix> </db> <default_setup> <connection> </connection> </default_setup> </resources> <session_save><![CDATA[memcache]]></session_save> <session_save_path><![CDATA[tcp://XXXX:11211?persistent=1&weight=2&timeout=10&retry_interval=10]]></session_save_path> <session_cache_limiter><![CDATA[private]]></session_cache_limiter> <cache> <backend>memcached</backend> <slow_backend>database</slow_backend> <slow_backend_store_data></slow_backend_store_data> <auto_refresh_fast_cache>1</auto_refresh_fast_cache> <memcached> <servers> <server> <host><![CDATA[XXXX]]></host> <port><![CDATA[11211]]></port> <persistent><![CDATA[1]]></persistent> </server> <server> <host><![CDATA[XXXX]]></host> <port><![CDATA[11211]]></port> <persistent><![CDATA[1]]></persistent> </server> </servers> </memcached> </cache> </global> <admin> <routers> <adminhtml> <args> <frontName><![CDATA[admin]]></frontName> </args> </adminhtml> </routers> </admin>
I also noticed other strange behavior, such as clearing the cache in the cache control window in the admin panel. This is normal when using memcached in Magento and how can I solve the problem of caching the entire page?
source share