Support the ongoing development of Laravel.io →
posted 3 years ago
Cache

Description:

Current memcached driver always call setOptions-method when creating memcached-object. We should avoid calling setOptions when we already have a connection. https://github.com/laravel/framework/blob/8.x/src/Illuminate/Cache/MemcachedConnector.php#L18-L59

Some options quit connections by calling send_quit-function of libmemcached library every time, so persistent-connection does not work. https://github.com/awesomized/libmemcached/blob/193e5b33334e6209b87d23740a93db8eeef942b1/src/libmemcached/behavior.cc#L48-L282

The options are as follows.

Memcached::OPT_BINARY_PROTOCOL
Memcached::OPT_NO_BLOCK
Memcached::OPT_USE_UDP
Memcached::OPT_TCP_NODELAY
Memcached::OPT_TCP_KEEPALIVE
Memcached::OPT_SOCKET_SEND_SIZE
Memcached::OPT_SOCKET_RECV_SIZE
Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.