3
votes

I'm trying to use TouchByKey which is a memcached function but this warning pops up:

Memcached::touchByKey(): touch is only supported with binary protocol

I found that I could use something like:$mc->setOption(\Memcached::OPT_BINARY_PROTOCOL, true); on the client side.

The same problem happens with Touch()

My question is, do I need to change anything on the memcache server itself? Why is this even requiring Binary protocol? Why isn't this functionality available for the current ASCII protocol?

1

1 Answers

3
votes

When the implementation was done it was only done for the binary protocol but and there is no specific reason why it can't be done for the ASCII protocol. The implementer likely just didn't want to spend the time to do both. Another thing I want to note is that the binary protocol is much faster than the ASCII protocol. Unless you have some specific reason for using ASCII I would recommend just switching to binary. Also if you would like to submit a patch for memcached to support the ASCII protocol I'm sure it would be merged by the project owners.