&reftitle.constants; &extension.constants;

`Memcached::OPT_COMPRESSION`

- Enables or disables payload compression. When enabled, item values longer than a certain threshold (currently 2000 bytes) will be compressed during storage and decompressed during retrieval transparently. The threshold can be configured using the memcached.compression_threshold ini setting.

  Type: `bool`, default: &true;.

`Memcached::OPT_COMPRESSION_TYPE`

- Specifies the compression algorithm to use, if compression is enabled. The valid algorithms are `Memcached::COMPRESSION_FASTLZ`, `Memcached::COMPRESSION_ZLIB` and `Memcached::COMPRESSION_ZSTD`.

  Type: `int`, default: `Memcached::COMPRESSION_FASTLZ`.

`Memcached::COMPRESSION_FASTLZ`

- The FASTLZ compression algorithm.

`Memcached::COMPRESSION_ZLIB`

- The ZLIB compression algorithm.

`Memcached::COMPRESSION_ZSTD`

- The ZSTD compression algorithm.

  Available as of Memcached 3.3.0.

`Memcached::OPT_COMPRESSION_LEVEL`

- Specifies the compression level to use, if compression is enabled.

  - `Memcached::COMPRESSION_FASTLZ` does not support compression levels.
  - `Memcached::COMPRESSION_ZSTD`: minimum level is `-22` and maximum level is `22`.
  - `Memcached::COMPRESSION_ZLIB`: minimum level is `0` and maximum level is `9`.

  Type: `int`, default: `3`.

`Memcached::OPT_SERIALIZER`

- Specifies the serializer to use for serializing non-scalar values. The valid serializers are `Memcached::SERIALIZER_PHP`, `Memcached::SERIALIZER_IGBINARY`, `Memcached::SERIALIZER_JSON`, `Memcached::SERIALIZER_JSON_ARRAY` and `Memcached::SERIALIZER_MSGPACK`.

  Type: `int`, default: `Memcached::SERIALIZER_IGBINARY` if available, then `Memcached::SERIALIZER_MSGPACK` if available, then `Memcached::SERIALIZER_PHP`.

`Memcached::SERIALIZER_PHP`

- The default PHP serializer.

`Memcached::SERIALIZER_IGBINARY`

- The igbinary serializer. Instead of textual representation it stores PHP data structures in a compact binary form, resulting in space and time gains.

  This serializer is supported only if memcached is configured with `--enable-memcached-igbinary` option and the igbinary extension is loaded.

`Memcached::SERIALIZER_JSON`

- The JSON serializer. This serializer deserializes JSON to an object.

`Memcached::SERIALIZER_JSON_ARRAY`

- The JSON array serializer. This serializer deserializes JSON to an associative array

`Memcached::SERIALIZER_MSGPACK`

- The MessagePack serializer.

  This serializer is supported only if memcached is configured with `--enable-memcached-msgpack` option and the `msgpack` extension is loaded.

`Memcached::OPT_PREFIX_KEY`

- This can be used to create a "domain" for your item keys. The value specified here will be prefixed to each of the keys. It cannot be longer than `128` characters and will reduce the maximum available key size. The prefix is applied only to the item keys, not to the server keys.

  Type: `string`, default: `""`.

`Memcached::OPT_HASH`

- Specifies the hashing algorithm used for the item keys. The valid values are supplied via `Memcached::HASH_`*`` constants. Each hash algorithm has its advantages and its disadvantages. Go with the default if you don't know or don't care.

  Type: `int`, default: `Memcached::HASH_DEFAULT`

`Memcached::HASH_DEFAULT`

- The default (Jenkins one-at-a-time) item key hashing algorithm.

`Memcached::HASH_MD5`

- MD5 item key hashing algorithm.

`Memcached::HASH_CRC`

- CRC item key hashing algorithm.

`Memcached::HASH_FNV1_64`

- FNV1_64 item key hashing algorithm.

`Memcached::HASH_FNV1A_64`

- FNV1_64A item key hashing algorithm.

`Memcached::HASH_FNV1_32`

- FNV1_32 item key hashing algorithm.

`Memcached::HASH_FNV1A_32`

- FNV1_32A item key hashing algorithm.

`Memcached::HASH_HSIEH`

- Hsieh item key hashing algorithm.

`Memcached::HASH_MURMUR`

- Murmur item key hashing algorithm.

`Memcached::OPT_DISTRIBUTION`

- Specifies the method of distributing item keys to the servers. Currently supported methods are modulo and consistent hashing. Consistent hashing delivers better distribution and allows servers to be added to the cluster with minimal cache losses.

  Type: `int`, default: `Memcached::DISTRIBUTION_MODULA`.

`Memcached::DISTRIBUTION_MODULA`

- Modulo-based key distribution algorithm.

`Memcached::DISTRIBUTION_CONSISTENT`

- Consistent hashing key distribution algorithm (based on libketama).

`Memcached::DISTRIBUTION_VIRTUAL_BUCKET`

- Virtual Bucket hashing key distribution algorithm (also called vbucket).

`Memcached::OPT_LIBKETAMA_COMPATIBLE`

- Enables or disables compatibility with libketama-like behavior. When enabled, the item key hashing algorithm is set to MD5 and distribution is set to be weighted consistent hashing distribution. This is useful because other libketama-based clients (Python, Ruby, etc.) with the same server configuration will be able to access the keys transparently.

  It is highly recommended to enable this option if you want to use consistent hashing, and it may be enabled by default in future releases.

  Type: `bool`, default: &false;.

`Memcached::OPT_LIBKETAMA_HASH`

- Specifies the hashing algorithm for host mapping.

  Type: `int`.

`Memcached::OPT_TCP_KEEPALIVE`

- Enables TCP keep alive.

  Type: `bool`, default: &false;.

`Memcached::OPT_BUFFER_WRITES`

- Enables or disables buffered I/O. Enabling buffered I/O causes storage commands to "buffer" instead of being sent. Any action that retrieves data causes this buffer to be sent to the remote connection. Quitting the connection or closing down the connection will also cause the buffered data to be pushed to the remote connection.

  Type: `bool`, default: &false;.

`Memcached::OPT_BINARY_PROTOCOL`

- Enable the use of the binary protocol. Please note that you cannot toggle this option on an open connection.

  Type: `bool`, default: &false;.

`Memcached::OPT_NO_BLOCK`

- Enables or disables asynchronous I/O. This is the fastest transport available for storage functions.

  Type: `bool`, default: &false;.

`Memcached::OPT_NOREPLY`

- Enables or disables ignoring the result of storage commands (set, add, replace, append, prepend, delete, increment, decrement, etc.). Storage commands will be sent without spending time waiting for a reply (there would be no reply). Retrieval commands such as `Memcached::get` are unaffected by this setting.

  Type: `bool`, default: &false;.

`Memcached::OPT_TCP_NODELAY`

- Enables or disables the no-delay feature for connecting sockets (may be faster in some environments).

  Type: `bool`, default: &false;.

`Memcached::OPT_SOCKET_SEND_SIZE`

- The maximum socket send buffer in bytes.

  Type: `int`, default: varies by platform/kernel configuration.

`Memcached::OPT_SOCKET_RECV_SIZE`

- The maximum socket receive buffer in bytes.

  Type: `int`, default: varies by platform/kernel configuration.

`Memcached::OPT_CONNECT_TIMEOUT`

- In non-blocking mode this set the value of the timeout during socket connection, in milliseconds.

  Type: `int`, default: `1000`.

`Memcached::OPT_RETRY_TIMEOUT`

- The amount of time, in seconds, to wait until retrying a failed connection attempt.

  Type: `int`, default: `2`.

`Memcached::OPT_DEAD_TIMEOUT`

- The amount of time, in seconds, to wait until retrying dead servers. `0` means no retry.

  Type: `int`, default: `0`.

`Memcached::OPT_SEND_TIMEOUT`

- Socket sending timeout, in microseconds. In cases where you cannot use non-blocking I/O this will allow you to still have timeouts on the sending of data.

  Type: `int`, default: `0`.

`Memcached::OPT_RECV_TIMEOUT`

- Socket reading timeout, in microseconds. In cases where you cannot use non-blocking I/O this will allow you to still have timeouts on the reading of data.

  Type: `int`, default: `0`.

`Memcached::OPT_POLL_TIMEOUT`

- Timeout for connection polling, in milliseconds.

  Type: `int`, default: `1000`.

`Memcached::OPT_CACHE_LOOKUPS`

- Enables or disables caching of DNS lookups.

  Type: `bool`, default: &false;.

`Memcached::OPT_SERVER_FAILURE_LIMIT`

- Specifies the failure limit for server connection attempts. The server will be removed after this many continuous connection failures.

  Type: `int`, default: `5`.

`Memcached::OPT_SERVER_TIMEOUT_LIMIT`

- Specifies the timeout limit for server connection attempts. The server will be removed after this many continuous connection timeouts.

  Type: `int`, default: `0`.

`Memcached::OPT_AUTO_EJECT_HOSTS`

- Removes disabled servers from the list. Use together with `Memcached::OPT_SERVER_FAILURE_LIMIT` and `Memcached::OPT_SERVER_TIMEOUT_LIMIT`.

  This option is replaced by `Memcached::OPT_REMOVE_FAILED_SERVERS`.

  Type: `bool`, default: &false;.

`Memcached::OPT_VERIFY_KEY`

- Enables verification of keys by memcached.

  Type: `bool`, default: &false;.

`Memcached::OPT_USE_UDP`

- Uses UDP instead of TCP.

  Type: `bool`, default: &false;.

`Memcached::OPT_NUMBER_OF_REPLICAS`

- Stores this many replicas of each item on different servers.

  Type: `int`, default: `0`.

`Memcached::OPT_RANDOMIZE_REPLICA_READS`

- Randomizes replica read server.

  Type: `bool`, default: &false;.

`Memcached::OPT_REMOVE_FAILED_SERVERS`

- Removes disabled servers from the list. Use together with `Memcached::OPT_SERVER_FAILURE_LIMIT` and `Memcached::OPT_SERVER_TIMEOUT_LIMIT`.

  Type: `bool`, default: &false;.

`Memcached::HAVE_IGBINARY`

- Indicates whether igbinary serializer support is available.

  Type: `bool`.

`Memcached::HAVE_JSON`

- Indicates whether JSON serializer support is available.

  Type: `bool`.

`Memcached::HAVE_MSGPACK`

- Indicates whether MessagePack serializer support is available.

  Type: `bool`.

  Available as of Memcached 3.0.0.

`Memcached::HAVE_ZSTD`

- Indicates whether ZSTD compression support is available.

  Type: `bool`.

  Available as of Memcached 3.3.0.

`Memcached::HAVE_ENCODING`

- Indicates whether data encryption using `Memcached::setEncodingKey` is supported.

  Type: `bool`.

  Available as of Memcached 3.1.0.

`Memcached::HAVE_SESSION`

- Type: `bool`.

  Available as of Memcached 3.0.0.

`Memcached::HAVE_SASL`

- Type: `bool`.

  Available as of Memcached 3.0.0.

`Memcached::GET_EXTENDED`

- A flag for `Memcached::get`, `Memcached::getMulti` and `Memcached::getMultiByKey` to ensure that the CAS token values are returned as well.

  Available as of Memcached 3.0.0.

`Memcached::GET_PRESERVE_ORDER`

- A flag for `Memcached::getMulti` and `Memcached::getMultiByKey` to ensure that the keys are returned in the same order as they were requested in. Non-existing keys get a default value of &null;.

`Memcached::RES_SUCCESS`

- The operation was successful.

`Memcached::RES_FAILURE`

- The operation failed in some fashion.

`Memcached::RES_HOST_LOOKUP_FAILURE`

- DNS lookup failed.

`Memcached::RES_UNKNOWN_READ_FAILURE`

- Failed to read network data.

`Memcached::RES_PROTOCOL_ERROR`

- Bad command in memcached protocol.

`Memcached::RES_CLIENT_ERROR`

- Error on the client side.

`Memcached::RES_SERVER_ERROR`

- Error on the server side.

`Memcached::RES_WRITE_FAILURE`

- Failed to write network data.

`Memcached::RES_DATA_EXISTS`

- Failed to do compare-and-swap: item you are trying to store has been modified since you last fetched it.

`Memcached::RES_NOTSTORED`

- Item was not stored: but not because of an error. This normally means that either the condition for an "add" or a "replace" command wasn't met, or that the item is in a delete queue.

`Memcached::RES_NOTFOUND`

- Item with this key was not found (with "get" operation or "cas" operations).

`Memcached::RES_PARTIAL_READ`

- Partial network data read error.

`Memcached::RES_SOME_ERRORS`

- Some errors occurred during multi-get.

`Memcached::RES_NO_SERVERS`

- Server list is empty.

`Memcached::RES_END`

- End of result set.

`Memcached::RES_ERRNO`

- System error.

`Memcached::RES_BUFFERED`

- The operation was buffered.

`Memcached::RES_TIMEOUT`

- The operation timed out.

`Memcached::RES_BAD_KEY_PROVIDED`

- Bad key.

`Memcached::RES_STORED`

- Item stored.

`Memcached::RES_DELETED`

- Item deleted.

`Memcached::RES_STAT`

- Statistics.

`Memcached::RES_ITEM`

- Item.

`Memcached::RES_NOT_SUPPORTED`

- Not supported.

`Memcached::RES_FETCH_NOTFINISHED`

- Fetch not finished.

`Memcached::RES_SERVER_MARKED_DEAD`

- Server marked dead.

`Memcached::RES_UNKNOWN_STAT_KEY`

- Unknown stat key.

`Memcached::RES_INVALID_HOST_PROTOCOL`

- Invalid host protocol.

`Memcached::RES_MEMORY_ALLOCATION_FAILURE`

- Memory allocation failure.

`Memcached::RES_CONNECTION_SOCKET_CREATE_FAILURE`

- Failed to create network socket.

`Memcached::RES_PAYLOAD_FAILURE`

- Payload failure: could not compress/decompress or serialize/unserialize the value.

`Memcached::RES_AUTH_PROBLEM`

- Available as of Memcached 3.0.0.

`Memcached::RES_AUTH_FAILURE`

- Available as of Memcached 3.0.0.

`Memcached::RES_AUTH_CONTINUE`

- Available as of Memcached 3.0.0.

`Memcached::RES_E2BIG`

- Available as of Memcached 3.0.0.

`Memcached::RES_KEY_TOO_BIG`

- Available as of Memcached 3.0.0.

`Memcached::RES_SERVER_TEMPORARILY_DISABLED`

- Available as of Memcached 3.0.0.

`Memcached::RES_SERVER_MEMORY_ALLOCATION_FAILURE`

- Available as of Memcached 3.0.0.