| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!-- Reviewed: no -->
- <sect1 id="zend.cache.backends">
- <title>Zend_Cache Backends</title>
- <para>
- There are two kinds of backends: standard ones and extended ones. Of course, extended backends
- offer more features.
- </para>
- <sect2 id="zend.cache.backends.file">
- <title>Zend_Cache_Backend_File</title>
- <para>
- This (extended) backends stores cache records into files (in a choosen directory).
- </para>
- <para>
- Available options are :
- </para>
- <table id="zend.cache.backends.file.table">
- <title>File Backend Options</title>
- <tgroup cols="4">
- <thead>
- <row>
- <entry>Option</entry>
- <entry>Data Type</entry>
- <entry>Default Value</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><code>cache_dir</code></entry>
- <entry><code>string</code></entry>
- <entry><code>'/tmp/'</code></entry>
- <entry>
- Directory where to store cache files
- </entry>
- </row>
- <row>
- <entry><code>file_locking</code></entry>
- <entry><code>boolean</code></entry>
- <entry><code>true</code></entry>
- <entry>
- Enable / disable file_locking : Can avoid cache corruption under
- bad circumstances but it doesn't help on multithread webservers
- or on NFS filesystems...
- </entry>
- </row>
- <row>
- <entry><code>read_control</code></entry>
- <entry><code>boolean</code></entry>
- <entry><code>true</code></entry>
- <entry>
- Enable / disable read control : if enabled, a control key is
- embedded in the cache file and this key is compared with the
- one calculated after the reading.
- </entry>
- </row>
- <row>
- <entry><code>read_control_type</code></entry>
- <entry><code>string</code></entry>
- <entry><code>'crc32'</code></entry>
- <entry>
- Type of read control (only if read control is enabled). Available values are :
- 'md5' (best but slowest), 'crc32' (lightly less safe but faster, better choice),
- 'adler32' (new choice, faster than crc32),
- 'strlen' for a length only test (fastest).
- </entry>
- </row>
- <row>
- <entry><code>hashed_directory_level</code></entry>
- <entry><code>int</code></entry>
- <entry><code>0</code></entry>
- <entry>
- Hashed directory structure level : 0 means "no hashed directory
- structure", 1 means "one level of directory", 2 means "two levels"...
- This option can speed up the cache only when you have many thousands of
- cache files. Only specific benchs can help you to choose the perfect
- value for you. Maybe, 1 or 2 is a good start.
- </entry>
- </row>
- <row>
- <entry><code>hashed_directory_umask</code></entry>
- <entry><code>int</code></entry>
- <entry><code>0700</code></entry>
- <entry>
- Umask for the hashed directory structure
- </entry>
- </row>
- <row>
- <entry><code>file_name_prefix</code></entry>
- <entry><code>string</code></entry>
- <entry><code>'zend_cache'</code></entry>
- <entry>
- prefix for cache files ; be really careful with this option because
- a too generic value in a system cache dir (like /tmp) can cause
- disasters when cleaning the cache
- </entry>
- </row>
- <row>
- <entry><code>cache_file_umask</code></entry>
- <entry><code>int</code></entry>
- <entry><code>0700</code></entry>
- <entry>
- umask for cache files
- </entry>
- </row>
- <row>
- <entry><code>metatadatas_array_max_size</code></entry>
- <entry><code>int</code></entry>
- <entry><code>100</code></entry>
- <entry>
- internal max size for the metadatas array (don't change this value unless you
- know what you are doing)
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </sect2>
- <sect2 id="zend.cache.backends.sqlite">
- <title>Zend_Cache_Backend_Sqlite</title>
- <para>
- This (extended) backends stores cache records into a SQLite database.
- </para>
- <para>
- Available options are :
- </para>
- <table id="zend.cache.backends.sqlite.table">
- <title>Sqlite Backend Options</title>
- <tgroup cols="4">
- <thead>
- <row>
- <entry>Option</entry>
- <entry>Data Type</entry>
- <entry>Default Value</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><code>cache_db_complete_path (mandatory)</code></entry>
- <entry><code>string</code></entry>
- <entry><code>null</code></entry>
- <entry>
- The complete path (filename included) of the SQLite database
- </entry>
- </row>
- <row>
- <entry><code>automatic_vacuum_factor</code></entry>
- <entry><code>int</code></entry>
- <entry><code>10</code></entry>
- <entry>
- Disable / Tune the automatic vacuum process.
- The automatic vacuum process defragment the database file (and make it smaller)
- when a clean() or delete() is called :
- 0 means no automatic vacuum ;
- 1 means systematic vacuum (when delete() or clean() methods are called) ;
- x (integer) > 1 => automatic vacuum randomly 1 times on x clean() or delete().
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </sect2>
- <sect2 id="zend.cache.backends.memcached">
- <title>Zend_Cache_Backend_Memcached</title>
- <para>
- This (extended) backends stores cache records into a memcached server. <ulink url="http://www.danga.com/memcached/">memcached</ulink>
- is a high-performance, distributed memory object caching system. To use this backend,
- you need a memcached daemon and <ulink url="http://pecl.php.net/package/memcache">the memcache PECL extension</ulink>.
- </para>
- <para>
- Be careful : with this backend, "tags" are not supported for the moment as
- the "doNotTestCacheValidity=true" argument.
- </para>
- <para>
- Available options are :
- </para>
- <table id="zend.cache.backends.memcached.table">
- <title>Memcached Backend Options</title>
- <tgroup cols="4">
- <thead>
- <row>
- <entry>Option</entry>
- <entry>Data Type</entry>
- <entry>Default Value</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><code>servers</code></entry>
- <entry><code>array</code></entry>
- <entry>
- <code>
- array(array('host' => 'localhost', 'port' => 11211, 'persistent' => true, 'weight' => 1,
- 'timeout' => 5, 'retry_interval' => 15, 'status' => true, 'failure_callback' => '' ))
- </code>
- </entry>
- <entry>
- An array of memcached servers ; each memcached server is described by an associative array :
- 'host' => (string) : the name of the memcached server,
- 'port' => (int) : the port of the memcached server,
- 'persistent' => (bool) : use or not persistent connections to this memcached server
- 'weight' => (int) :the weight of the memcached server,
- 'timeout' => (int) :the time out of the memcached server,
- 'retry_interval' => (int) :the retry interval of the memcached server,
- 'status' => (bool) :the status of the memcached server,
- 'failure_callback' => (callback) : the failure_callback of the memcached server
- </entry>
- </row>
- <row>
- <entry><code>compression</code></entry>
- <entry><code>boolean</code></entry>
- <entry><code>false</code></entry>
- <entry>
- true if you want to use on-the-fly compression
- </entry>
- </row>
- <row>
- <entry><code>compatibility</code></entry>
- <entry><code>boolean</code></entry>
- <entry><code>false</code></entry>
- <entry>
- true if you want to use this compatibility mode with old memcache servers/extensions
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </sect2>
- <sect2 id="zend.cache.backends.apc">
- <title>Zend_Cache_Backend_Apc</title>
- <para>
- This (extended) backends stores cache records in shared memory through
- the <ulink url="http://pecl.php.net/package/APC">APC</ulink> (Alternative PHP Cache) extension
- (which is of course need for using this backend).
- </para>
- <para>
- Be careful : with this backend, "tags" are not supported for the moment as
- the "doNotTestCacheValidity=true" argument.
- </para>
- <para>
- There is no option for this backend.
- </para>
- </sect2>
- <sect2 id="zend.cache.backends.xcache">
- <title>Zend_Cache_Backend_Xcache</title>
- <para>
- This backends stores cache records in shared memory through
- the <ulink url="http://xcache.lighttpd.net/">XCache</ulink> extension
- (which is of course need for using this backend).
- </para>
- <para>
- Be careful : with this backend, "tags" are not supported for the moment as
- the "doNotTestCacheValidity=true" argument.
- </para>
- <para>
- Available options are :
- </para>
- <table id="zend.cache.backends.xcache.table">
- <title>Xcache Backend Options</title>
- <tgroup cols="4">
- <thead>
- <row>
- <entry>Option</entry>
- <entry>Data Type</entry>
- <entry>Default Value</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><code>user</code></entry>
- <entry><code>string</code></entry>
- <entry><code>null</code></entry>
- <entry>
- xcache.admin.user, necessary for the clean() method
- </entry>
- </row>
- <row>
- <entry><code>password</code></entry>
- <entry><code>string</code></entry>
- <entry><code>null</code></entry>
- <entry>
- xcache.admin.pass (in clear form, not MD5), necessary for the clean() method
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </sect2>
- <sect2 id="zend.cache.backends.platform">
- <title>Zend_Cache_Backend_ZendPlatform</title>
- <para>
- This backend uses content caching API of the <ulink url="http://www.zend.com/products/platform">Zend Platform</ulink> product. Naturally, to use this backend you need to have Zend Platform installed.
- </para>
- <para>
- This backend supports tags, but does not support <code>CLEANING_MODE_NOT_MATCHING_TAG</code> cleaning mode.
- </para>
- <para>
- Specify this backend using a word separator -- '-', '.', ' ', or '_'
- -- between the words 'Zend' and 'Platform' when using the
- <classname>Zend_Cache::factory()</classname> method:
- </para>
- <programlisting role="php"><![CDATA[
- $cache = Zend_Cache::factory('Core', 'Zend Platform');
- ]]></programlisting>
- <para>
- There are no options for this backend.
- </para>
- </sect2>
- <sect2 id="zend.cache.backends.twolevels">
- <title>Zend_Cache_Backend_TwoLevels</title>
- <para>
- This (extend) backend is an hybrid one. It stores cache records in two other backends : a fast
- one (but limited) like Apc, Memcache... and a "slow" one like File, Sqlite...
- </para>
- <para>
- This backend will use the priority parameter (given at the frontend level when storing a record)
- and the remaining space in the fast backend to optimize the usage of these two backends.
- FIXME
- </para>
- <para>
- Available options are :
- </para>
- <table id="zend.cache.backends.twolevels.table">
- <title>TwoLevels Backend Options</title>
- <tgroup cols="4">
- <thead>
- <row>
- <entry>Option</entry>
- <entry>Data Type</entry>
- <entry>Default Value</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><code>slow_backend</code></entry>
- <entry><code>string</code></entry>
- <entry><code>File</code></entry>
- <entry>
- the "slow" backend name
- </entry>
- </row>
- <row>
- <entry><code>fast_backend</code></entry>
- <entry><code>string</code></entry>
- <entry><code>Apc</code></entry>
- <entry>
- the "fast" backend name
- </entry>
- </row>
- <row>
- <entry><code>slow_backend_options</code></entry>
- <entry><code>array</code></entry>
- <entry><code>array()</code></entry>
- <entry>
- the "slow" backend options
- </entry>
- </row>
- <row>
- <entry><code>fast_backend_options</code></entry>
- <entry><code>array</code></entry>
- <entry><code>array()</code></entry>
- <entry>
- the "fast" backend options
- </entry>
- </row>
- <row>
- <entry><code>slow_backend_custom_naming</code></entry>
- <entry><code>boolean</code></entry>
- <entry><code>false</code></entry>
- <entry>
- if true, the slow_backend argument is used as a complete class name ; if false,
- the frontend argument is used as the end of "Zend_Cache_Backend_[...]"
- class name
- </entry>
- </row>
- <row>
- <entry><code>fast_backend_custom_naming</code></entry>
- <entry><code>boolean</code></entry>
- <entry><code>false</code></entry>
- <entry>
- if true, the fast_backend argument is used as a complete class name ; if false,
- the frontend argument is used as the end of "Zend_Cache_Backend_[...]"
- class name
- </entry>
- </row>
- <row>
- <entry><code>slow_backend_autoload</code></entry>
- <entry><code>boolean</code></entry>
- <entry><code>false</code></entry>
- <entry>
- if true, there will no require_once for the slow backend
- (useful only for custom backends)
- </entry>
- </row>
- <row>
- <entry><code>fast_backend_autoload</code></entry>
- <entry><code>boolean</code></entry>
- <entry><code>false</code></entry>
- <entry>
- if true, there will no require_once for the fast backend
- (useful only for custom backends)
- </entry>
- </row>
- <row>
- <entry><code>auto_refresh_fast_cache</code></entry>
- <entry><code>boolean</code></entry>
- <entry><code>true</code></entry>
- <entry>
- if true, auto refresh the fast cache when a cache record is hit
- </entry>
- </row>
- <row>
- <entry><code>stats_update_factor</code></entry>
- <entry><code>integer</code></entry>
- <entry><code>10</code></entry>
- <entry>
- disable / tune the computation of the fast backend filling percentage
- (when saving a record into cache, computation of the fast backend filling percentage
- randomly 1 times on x cache writes)
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </sect2>
- <sect2 id="zend.cache.backends.zendserver">
- <title>Zend_Cache_Backend_ZendServer_Disk and Zend_Cache_Backend_ZendServer_ShMem</title>
- <para>
- These backends store cache records using
- <ulink url="http://www.zend.com/en/products/server/downloads-all?zfs=zf_download">Zend Server</ulink> caching functionality.
- </para>
- <para>
- Be careful: with these backends, "tags" are not supported for the moment as the "doNotTestCacheValidity=true" argument.
- </para>
- <para>
- These backend work only withing Zend Server environment for pages requested through HTTP(S) and
- don't work for command line script execution
- </para>
- <para>
- There is no option for this backend.
- </para>
- </sect2>
- </sect1>
- <!--
- vim:se ts=4 sw=4 et:
- -->
|