Zend_Cache-Backends.xml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect1 id="zend.cache.backends">
  4. <title>Zend_Cache Backends</title>
  5. <para>
  6. There are two kinds of backends: standard ones and extended ones. Of course, extended
  7. backends offer more features.
  8. </para>
  9. <sect2 id="zend.cache.backends.file">
  10. <title>Zend_Cache_Backend_File</title>
  11. <para>
  12. This (extended) backends stores cache records into files (in a choosen directory).
  13. </para>
  14. <para>
  15. Available options are :
  16. </para>
  17. <table id="zend.cache.backends.file.table">
  18. <title>File Backend Options</title>
  19. <tgroup cols="4">
  20. <thead>
  21. <row>
  22. <entry>Option</entry>
  23. <entry>Data Type</entry>
  24. <entry>Default Value</entry>
  25. <entry>Description</entry>
  26. </row>
  27. </thead>
  28. <tbody>
  29. <row>
  30. <entry><emphasis>cache_dir</emphasis></entry>
  31. <entry><type>String</type></entry>
  32. <entry>'<filename>/tmp/</filename>'</entry>
  33. <entry>
  34. Directory where to store cache files
  35. </entry>
  36. </row>
  37. <row>
  38. <entry><emphasis>file_locking</emphasis></entry>
  39. <entry><type>Boolean</type></entry>
  40. <entry><constant>TRUE</constant></entry>
  41. <entry>
  42. Enable or disable file_locking : Can avoid cache corruption under
  43. bad circumstances but it doesn't help on multithread webservers
  44. or on <acronym>NFS</acronym> filesystems...
  45. </entry>
  46. </row>
  47. <row>
  48. <entry><emphasis>read_control</emphasis></entry>
  49. <entry><type>Boolean</type></entry>
  50. <entry><constant>TRUE</constant></entry>
  51. <entry>
  52. Enable / disable read control : if enabled, a control key is
  53. embedded in the cache file and this key is compared with the
  54. one calculated after the reading.
  55. </entry>
  56. </row>
  57. <row>
  58. <entry><emphasis>read_control_type</emphasis></entry>
  59. <entry><type>String</type></entry>
  60. <entry>'crc32'</entry>
  61. <entry>
  62. Type of read control (only if read control is enabled). Available values
  63. are : 'md5' (best but slowest), 'crc32' (lightly less safe but faster,
  64. better choice), 'adler32' (new choice, faster than crc32),
  65. 'strlen' for a length only test (fastest).
  66. </entry>
  67. </row>
  68. <row>
  69. <entry><emphasis>hashed_directory_level</emphasis></entry>
  70. <entry><type>Integer</type></entry>
  71. <entry>0</entry>
  72. <entry>
  73. Hashed directory structure level : 0 means "no hashed directory
  74. structure", 1 means "one level of directory", 2 means "two levels"...
  75. This option can speed up the cache only when you have many thousands of
  76. cache files. Only specific benchs can help you to choose the perfect
  77. value for you. Maybe, 1 or 2 is a good start.
  78. </entry>
  79. </row>
  80. <row>
  81. <entry><emphasis>hashed_directory_umask</emphasis></entry>
  82. <entry><type>Integer</type></entry>
  83. <entry>0700</entry>
  84. <entry>
  85. Umask for the hashed directory structure
  86. </entry>
  87. </row>
  88. <row>
  89. <entry><emphasis>file_name_prefix</emphasis></entry>
  90. <entry><type>String</type></entry>
  91. <entry>'zend_cache'</entry>
  92. <entry>
  93. prefix for cache files ; be really careful with this option because
  94. a too generic value in a system cache dir
  95. (like <filename>/tmp</filename>) can cause disasters when cleaning
  96. the cache
  97. </entry>
  98. </row>
  99. <row>
  100. <entry><emphasis>cache_file_umask</emphasis></entry>
  101. <entry><type>Integer</type></entry>
  102. <entry>0700</entry>
  103. <entry>
  104. umask for cache files
  105. </entry>
  106. </row>
  107. <row>
  108. <entry><emphasis>metatadatas_array_max_size</emphasis></entry>
  109. <entry><type>Integer</type></entry>
  110. <entry>100</entry>
  111. <entry>
  112. internal max size for the metadatas array (don't change this value
  113. unless you know what you are doing)
  114. </entry>
  115. </row>
  116. </tbody>
  117. </tgroup>
  118. </table>
  119. </sect2>
  120. <sect2 id="zend.cache.backends.sqlite">
  121. <title>Zend_Cache_Backend_Sqlite</title>
  122. <para>
  123. This (extended) backends stores cache records into a SQLite database.
  124. </para>
  125. <para>
  126. Available options are :
  127. </para>
  128. <table id="zend.cache.backends.sqlite.table">
  129. <title>Sqlite Backend Options</title>
  130. <tgroup cols="4">
  131. <thead>
  132. <row>
  133. <entry>Option</entry>
  134. <entry>Data Type</entry>
  135. <entry>Default Value</entry>
  136. <entry>Description</entry>
  137. </row>
  138. </thead>
  139. <tbody>
  140. <row>
  141. <entry><emphasis>cache_db_complete_path (mandatory)</emphasis></entry>
  142. <entry><type>String</type></entry>
  143. <entry><constant>NULL</constant></entry>
  144. <entry>
  145. The complete path (filename included) of the SQLite database
  146. </entry>
  147. </row>
  148. <row>
  149. <entry><emphasis>automatic_vacuum_factor</emphasis></entry>
  150. <entry><type>Integer</type></entry>
  151. <entry>10</entry>
  152. <entry>
  153. Disable / Tune the automatic vacuum process. The automatic vacuum
  154. process defragment the database file (and make it smaller) when a
  155. <methodname>clean()</methodname> or <methodname>delete()</methodname>
  156. is called: 0 means no automatic vacuum ; 1 means systematic vacuum
  157. (when <methodname>delete()</methodname> or
  158. <methodname>clean()</methodname> methods are called) ; x (integer) >
  159. 1 => automatic vacuum randomly 1 times on x
  160. <methodname>clean()</methodname> or
  161. <methodname>delete()</methodname>.
  162. </entry>
  163. </row>
  164. </tbody>
  165. </tgroup>
  166. </table>
  167. </sect2>
  168. <sect2 id="zend.cache.backends.memcached">
  169. <title>Zend_Cache_Backend_Memcached</title>
  170. <para>
  171. This (extended) backends stores cache records into a memcached server. <ulink
  172. url="http://www.danga.com/memcached/">memcached</ulink> is a high-performance,
  173. distributed memory object caching system. To use this backend, you need a memcached
  174. daemon and <ulink url="http://pecl.php.net/package/memcache">the memcache PECL
  175. extension</ulink>.
  176. </para>
  177. <para>
  178. Be careful : with this backend, "tags" are not supported for the moment as
  179. the "doNotTestCacheValidity=true" argument.
  180. </para>
  181. <para>
  182. Available options are :
  183. </para>
  184. <table id="zend.cache.backends.memcached.table">
  185. <title>Memcached Backend Options</title>
  186. <tgroup cols="4">
  187. <thead>
  188. <row>
  189. <entry>Option</entry>
  190. <entry>Data Type</entry>
  191. <entry>Default Value</entry>
  192. <entry>Description</entry>
  193. </row>
  194. </thead>
  195. <tbody>
  196. <row>
  197. <entry><emphasis>servers</emphasis></entry>
  198. <entry><type>Array</type></entry>
  199. <entry>
  200. array(array('host' => 'localhost', 'port' => 11211, 'persistent' =>
  201. true, 'weight' => 1, 'timeout' => 5, 'retry_interval' => 15,
  202. 'status' => true, 'failure_callback' => '' ))
  203. </entry>
  204. <entry>
  205. An array of memcached servers ; each memcached server is described by
  206. an associative array : 'host' => (string) : the name of the memcached
  207. server, 'port' => (int) : the port of the memcached server,
  208. 'persistent' => (bool) : use or not persistent connections to this
  209. memcached server 'weight' => (int) :the weight of the memcached
  210. server, 'timeout' => (int) :the time out of the memcached server,
  211. 'retry_interval' => (int) :the retry interval of the memcached server,
  212. 'status' => (bool) :the status of the memcached server,
  213. 'failure_callback' => (callback) : the failure_callback of the
  214. memcached server
  215. </entry>
  216. </row>
  217. <row>
  218. <entry><emphasis>compression</emphasis></entry>
  219. <entry><type>Boolean</type></entry>
  220. <entry><constant>FALSE</constant></entry>
  221. <entry>
  222. true if you want to use on-the-fly compression
  223. </entry>
  224. </row>
  225. <row>
  226. <entry><emphasis>compatibility</emphasis></entry>
  227. <entry><type>Boolean</type></entry>
  228. <entry><constant>FALSE</constant></entry>
  229. <entry>
  230. true if you want to use this compatibility mode with old memcache
  231. servers or extensions
  232. </entry>
  233. </row>
  234. </tbody>
  235. </tgroup>
  236. </table>
  237. </sect2>
  238. <sect2 id="zend.cache.backends.apc">
  239. <title>Zend_Cache_Backend_Apc</title>
  240. <para>
  241. This (extended) backends stores cache records in shared memory through
  242. the <ulink url="http://pecl.php.net/package/APC">APC</ulink> (Alternative
  243. <acronym>PHP</acronym> Cache) extension (which is of course need for using this
  244. backend).
  245. </para>
  246. <para>
  247. Be careful : with this backend, "tags" are not supported for the moment as
  248. the "doNotTestCacheValidity=true" argument.
  249. </para>
  250. <para>
  251. There is no option for this backend.
  252. </para>
  253. </sect2>
  254. <sect2 id="zend.cache.backends.xcache">
  255. <title>Zend_Cache_Backend_Xcache</title>
  256. <para>
  257. This backends stores cache records in shared memory through
  258. the <ulink url="http://xcache.lighttpd.net/">XCache</ulink> extension
  259. (which is of course need for using this backend).
  260. </para>
  261. <para>
  262. Be careful : with this backend, "tags" are not supported for the moment as
  263. the "doNotTestCacheValidity=true" argument.
  264. </para>
  265. <para>
  266. Available options are :
  267. </para>
  268. <table id="zend.cache.backends.xcache.table">
  269. <title>Xcache Backend Options</title>
  270. <tgroup cols="4">
  271. <thead>
  272. <row>
  273. <entry>Option</entry>
  274. <entry>Data Type</entry>
  275. <entry>Default Value</entry>
  276. <entry>Description</entry>
  277. </row>
  278. </thead>
  279. <tbody>
  280. <row>
  281. <entry><emphasis>user</emphasis></entry>
  282. <entry><type>String</type></entry>
  283. <entry><constant>NULL</constant></entry>
  284. <entry>
  285. <filename>xcache.admin.user</filename>, necessary for the
  286. <methodname>clean()</methodname> method
  287. </entry>
  288. </row>
  289. <row>
  290. <entry><emphasis>password</emphasis></entry>
  291. <entry><type>String</type></entry>
  292. <entry><constant>NULL</constant></entry>
  293. <entry>
  294. <filename>xcache.admin.pass</filename> (in clear form, not
  295. <acronym>MD5</acronym>), necessary for the
  296. <methodname>clean()</methodname> method
  297. </entry>
  298. </row>
  299. </tbody>
  300. </tgroup>
  301. </table>
  302. </sect2>
  303. <sect2 id="zend.cache.backends.platform">
  304. <title>Zend_Cache_Backend_ZendPlatform</title>
  305. <para>
  306. This backend uses content caching <acronym>API</acronym> of the <ulink
  307. url="http://www.zend.com/products/platform">Zend Platform</ulink> product.
  308. Naturally, to use this backend you need to have Zend Platform installed.
  309. </para>
  310. <para>
  311. This backend supports tags, but does not support
  312. <constant>CLEANING_MODE_NOT_MATCHING_TAG</constant> cleaning mode.
  313. </para>
  314. <para>
  315. Specify this backend using a word separator -- '-', '.', ' ', or '_'
  316. -- between the words 'Zend' and 'Platform' when using the
  317. <methodname>Zend_Cache::factory()</methodname> method:
  318. </para>
  319. <programlisting language="php"><![CDATA[
  320. $cache = Zend_Cache::factory('Core', 'Zend Platform');
  321. ]]></programlisting>
  322. <para>
  323. There are no options for this backend.
  324. </para>
  325. </sect2>
  326. <sect2 id="zend.cache.backends.twolevels">
  327. <title>Zend_Cache_Backend_TwoLevels</title>
  328. <para>
  329. This (extend) backend is an hybrid one. It stores cache records in two other backends :
  330. a fast one (but limited) like Apc, Memcache... and a "slow" one like File, Sqlite...
  331. </para>
  332. <para>
  333. This backend will use the priority parameter (given at the frontend level when storing a
  334. record) and the remaining space in the fast backend to optimize the usage of these two
  335. backends.
  336. </para>
  337. <para>
  338. Available options are :
  339. </para>
  340. <table id="zend.cache.backends.twolevels.table">
  341. <title>TwoLevels Backend Options</title>
  342. <tgroup cols="4">
  343. <thead>
  344. <row>
  345. <entry>Option</entry>
  346. <entry>Data Type</entry>
  347. <entry>Default Value</entry>
  348. <entry>Description</entry>
  349. </row>
  350. </thead>
  351. <tbody>
  352. <row>
  353. <entry><emphasis>slow_backend</emphasis></entry>
  354. <entry><type>String</type></entry>
  355. <entry>File</entry>
  356. <entry>
  357. the "slow" backend name
  358. </entry>
  359. </row>
  360. <row>
  361. <entry><emphasis>fast_backend</emphasis></entry>
  362. <entry><type>String</type></entry>
  363. <entry>Apc</entry>
  364. <entry>
  365. the "fast" backend name
  366. </entry>
  367. </row>
  368. <row>
  369. <entry><emphasis>slow_backend_options</emphasis></entry>
  370. <entry><type>Array</type></entry>
  371. <entry><methodname>array()</methodname></entry>
  372. <entry>
  373. the "slow" backend options
  374. </entry>
  375. </row>
  376. <row>
  377. <entry><emphasis>fast_backend_options</emphasis></entry>
  378. <entry><type>Array</type></entry>
  379. <entry><methodname>array()</methodname></entry>
  380. <entry>
  381. the "fast" backend options
  382. </entry>
  383. </row>
  384. <row>
  385. <entry><emphasis>slow_backend_custom_naming</emphasis></entry>
  386. <entry><type>Boolean</type></entry>
  387. <entry><constant>FALSE</constant></entry>
  388. <entry>
  389. if true, the slow_backend argument is used as a complete class name ;
  390. if false, the frontend argument is used as the end of
  391. "<classname>Zend_Cache_Backend_</classname>[...]" class name
  392. </entry>
  393. </row>
  394. <row>
  395. <entry><emphasis>fast_backend_custom_naming</emphasis></entry>
  396. <entry><type>Boolean</type></entry>
  397. <entry><constant>FALSE</constant></entry>
  398. <entry>
  399. if true, the fast_backend argument is used as a complete class name ;
  400. if false, the frontend argument is used as the end of
  401. "<classname>Zend_Cache_Backend_</classname>[...]" class name
  402. </entry>
  403. </row>
  404. <row>
  405. <entry><emphasis>slow_backend_autoload</emphasis></entry>
  406. <entry><type>Boolean</type></entry>
  407. <entry><constant>FALSE</constant></entry>
  408. <entry>
  409. if true, there will no require_once for the slow backend
  410. (useful only for custom backends)
  411. </entry>
  412. </row>
  413. <row>
  414. <entry><emphasis>fast_backend_autoload</emphasis></entry>
  415. <entry><type>Boolean</type></entry>
  416. <entry><constant>FALSE</constant></entry>
  417. <entry>
  418. if true, there will no require_once for the fast backend
  419. (useful only for custom backends)
  420. </entry>
  421. </row>
  422. <row>
  423. <entry><emphasis>auto_refresh_fast_cache</emphasis></entry>
  424. <entry><type>Boolean</type></entry>
  425. <entry><constant>TRUE</constant></entry>
  426. <entry>
  427. if true, auto refresh the fast cache when a cache record is hit
  428. </entry>
  429. </row>
  430. <row>
  431. <entry><emphasis>stats_update_factor</emphasis></entry>
  432. <entry><type>Integer</type></entry>
  433. <entry>10</entry>
  434. <entry>
  435. disable / tune the computation of the fast backend filling percentage
  436. (when saving a record into cache, computation of the fast backend
  437. filling percentage randomly 1 times on x cache writes)
  438. </entry>
  439. </row>
  440. </tbody>
  441. </tgroup>
  442. </table>
  443. </sect2>
  444. <sect2 id="zend.cache.backends.zendserver">
  445. <title>Zend_Cache_Backend_ZendServer_Disk and Zend_Cache_Backend_ZendServer_ShMem</title>
  446. <para>
  447. These backends store cache records using <ulink
  448. url="http://www.zend.com/en/products/server/downloads-all?zfs=zf_download">Zend
  449. Server</ulink> caching functionality.
  450. </para>
  451. <para>
  452. Be careful: with these backends, "tags" are not supported for the moment as the
  453. "doNotTestCacheValidity=true" argument.
  454. </para>
  455. <para>
  456. These backend work only withing Zend Server environment for pages requested through
  457. <acronym>HTTP</acronym> or <acronym>HTTPS</acronym> and don't work for command line
  458. script execution
  459. </para>
  460. <para>
  461. There is no option for this backend.
  462. </para>
  463. </sect2>
  464. </sect1>
  465. <!--
  466. vim:se ts=4 sw=4 et:
  467. -->