downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Memcache::setServerParams> <Memcache::set
[edit] Last updated: Fri, 24 May 2013

view this page in

Memcache::setCompressThreshold

(PECL memcache >= 2.0.0)

Memcache::setCompressThreshold开启大值自动压缩

说明

bool Memcache::setCompressThreshold ( int $threshold [, float $min_savings ] )

Memcache::setCompressThreshold()开启对于大值的自动压缩。 同样你也可以使用函数 memcache_set_compress_threshold()

Note:

此函数在memcache2.0.0加入。

参数

threshold

控制多大值进行自动压缩的阈值。

min_saving

指定经过压缩实际存储的值的压缩率,支持的值必须在0和1之间。默认值是0.2表示20%压缩率。

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

范例

Example #1 Memcache::setCompressThreshold() 示例

<?php

/* OO API */

$memcache_obj = new Memcache;
$memcache_obj->addServer('memcache_host'11211);
$memcache_obj->setCompressThreshold(200000.2);

/* procedural API */

$memcache_obj memcache_connect('memcache_host'11211);
memcache_set_compress_threshold($memcache_obj200000.2);

?>



add a note add a note User Contributed Notes Memcache::setCompressThreshold - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites