array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'memcache.setcompressthreshold.php', 1 => 'Memcache::setCompressThreshold', ), 'up' => array ( 0 => 'class.memcache.php', 1 => 'Memcache', ), 'prev' => array ( 0 => 'memcache.set.php', 1 => 'Memcache::set', ), 'next' => array ( 0 => 'memcache.setserverparams.php', 1 => 'Memcache::setServerParams', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/memcache/memcache/setcompressthreshold.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL memcache >= 2.0.0)
Memcache::setCompressThreshold — Enable automatic compression of large values
Memcache::setCompressThreshold() enables automatic compression of large values. You can also use the memcache_set_compress_threshold() function.
Bilginize:
This function has been added to Memcache version 2.0.0.
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.
Örnek 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);
?>