Enable automatic compression of large values

# Memcache::setCompressThreshold

# memcache_set_compress_threshold

(PECL memcache >= 2.0.0)

Memcache::setCompressThreshold -- memcache_set_compress_threshold — Enable automatic compression of large values

### Description

Memcache::setCompressThreshold(int `$threshold`, float `$min_savings` = ?): bool
memcache_set_compress_threshold(Memcache `$memcache`, int `$threshold`, float `$min_savings` = ?): bool

Memcache::setCompressThreshold() enables automatic compression of large values.

> Note: This function has been added to Memcache version 2.0.0.

### Parameters

`threshold`
  Controls the minimum value length before attempting to compress automatically.
`min_saving`
  Specifies the minimum amount of savings to actually store the value compressed. The supplied value must be between 0 and 1. Default value is 0.2 giving a minimum 20% compression savings.

### Return Values

Returns `true` on success or `false` on failure.

### Examples

Example #1 Memcache::setCompressThreshold() example

`<?php
/* OO API */
$memcache_obj = new Memcache;
$memcache_obj->addServer('memcache_host', 11211);
$memcache_obj->setCompressThreshold(20000, 0.2);
/* procedural API */
$memcache_obj = memcache_connect('memcache_host', 11211);
memcache_set_compress_threshold($memcache_obj, 20000, 0.2);
?>`
`↑` and `↓` to navigate • `Enter` to select • `Esc` to close • `/` to open