in a setup with multiple magento frontends i discovered that using a shared memcached as a cache backend over the network slows down the frontends (probably because of network latency) in comparison to a memcached which runs on each frontend and is accessed via socket.
my idea was thus to write a cache backend which stores and reads cache entries locally on each frontend. so far this is simple, only invalidation is the problem, if an action occurs where one frontend invalidates a cache entry the other frontends would not notice that.
so to invalidate the other frontends i send all remove and flush commands to all other nodes using curl and a php-script to issue the same command locally.
node1: get X : false node1: store X node2: get X : false node2: store X node1: remove X : true
now node2 remains to have the old version of X
now with the "distributed command":
node1: get X : false node1: store X node2: get X : false node2: store X node1: remove X : true node1: --> node2: remove X : true
now both nodes would store a fresh version of X next time it is needed
is this insane or does it make sense? is there something out there which does that already? am i missing a point about memcached using multiple servers? should the network latency not be a bottleneck? to clarify: by reading locally from memcached i was able to speed up a category view by 100ms (currently it is at around 300) so imho this is worth the trouble.