php-doc-en/reference/memcache/functions/memcache-setcompressthreshold.xml

112 lines
2.7 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<refentry id="function.Memcache-setCompressThreshold">
<refnamediv>
<refname>Memcache::setCompressThreshold</refname>
<refpurpose>Enable automatic compression of large values</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<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.
You can also use the <function>memcache_set_compress_threshold</function> function.
</para>
<note>
<para>
This function has been added to Memcache version 2.0.0.
</para>
</note>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>threshold</parameter></term>
<listitem>
<para>
Controls the minimum value length before attempting to compress automatically.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>min_saving</parameter></term>
<listitem>
<para>
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>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<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>
</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
-->