php-doc-en/reference/memcache/functions/memcache-setcompressthreshold.xml
2005-12-23 16:17:38 +00:00

74 lines
2.2 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<refentry id="function.Memcache-setCompressThreshold">
<refnamediv>
<refname>Memcache::setCompressThreshold</refname>
<refpurpose>Enable automatic compression of large values</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>Memcache::setCompressThreshold</methodname>
<methodparam><type>int</type><parameter>threshold</parameter></methodparam>
<methodparam choice="opt"><type>float</type><parameter>min_savings</parameter></methodparam>
</methodsynopsis>
<para>
<function>Memcache::setCompressThreshold</function> enables automatic
compression of large values. Parameter <parameter>threshold</parameter>
controls the minimum value length before attempting to compress automatically.
Parameter <parameter>min_savings</parameter> 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.
</para>
<para>
You can also use the <function>memcache_set_compress_threshold</function> function.
See example below.
</para>
<example>
<title><function>Memcache::setCompressThreshold</function> example</title>
<programlisting role="php">
<![CDATA[
<?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);
?>
]]>
</programlisting>
</example>
<para>
&return.success;
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->