Zend_Cache-Backends.xml 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701
  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
  175. <acronym>PECL</acronym> 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. <command>array(array('host' => 'localhost', 'port' => 11211,
  201. 'persistent' => true, 'weight' => 1, 'timeout' => 5,
  202. 'retry_interval' => 15, 'status' => true,
  203. 'failure_callback' => '' ))</command>
  204. </entry>
  205. <entry>
  206. An array of memcached servers ; each memcached server is described by
  207. an associative array : 'host' => (string) : the name of the memcached
  208. server, 'port' => (int) : the port of the memcached server,
  209. 'persistent' => (bool) : use or not persistent connections to this
  210. memcached server 'weight' => (int) :the weight of the memcached
  211. server, 'timeout' => (int) :the time out of the memcached server,
  212. 'retry_interval' => (int) :the retry interval of the memcached server,
  213. 'status' => (bool) :the status of the memcached server,
  214. 'failure_callback' => (callback) : the failure_callback of the
  215. memcached server
  216. </entry>
  217. </row>
  218. <row>
  219. <entry><emphasis>compression</emphasis></entry>
  220. <entry><type>Boolean</type></entry>
  221. <entry><constant>FALSE</constant></entry>
  222. <entry>
  223. <constant>TRUE</constant> if you want to use on-the-fly compression
  224. </entry>
  225. </row>
  226. <row>
  227. <entry><emphasis>compatibility</emphasis></entry>
  228. <entry><type>Boolean</type></entry>
  229. <entry><constant>FALSE</constant></entry>
  230. <entry>
  231. <constant>TRUE</constant> if you want to use this compatibility mode
  232. with old memcache servers or extensions
  233. </entry>
  234. </row>
  235. </tbody>
  236. </tgroup>
  237. </table>
  238. </sect2>
  239. <sect2 id="zend.cache.backends.apc">
  240. <title>Zend_Cache_Backend_Apc</title>
  241. <para>
  242. This (extended) backends stores cache records in shared memory through
  243. the <ulink url="http://pecl.php.net/package/APC">APC</ulink> (Alternative
  244. <acronym>PHP</acronym> Cache) extension (which is of course need for using this
  245. backend).
  246. </para>
  247. <para>
  248. Be careful : with this backend, "tags" are not supported for the moment as
  249. the "doNotTestCacheValidity=true" argument.
  250. </para>
  251. <para>
  252. There is no option for this backend.
  253. </para>
  254. </sect2>
  255. <sect2 id="zend.cache.backends.xcache">
  256. <title>Zend_Cache_Backend_Xcache</title>
  257. <para>
  258. This backends stores cache records in shared memory through
  259. the <ulink url="http://xcache.lighttpd.net/">XCache</ulink> extension
  260. (which is of course need for using this backend).
  261. </para>
  262. <para>
  263. Be careful : with this backend, "tags" are not supported for the moment as
  264. the "doNotTestCacheValidity=true" argument.
  265. </para>
  266. <para>
  267. Available options are :
  268. </para>
  269. <table id="zend.cache.backends.xcache.table">
  270. <title>Xcache Backend Options</title>
  271. <tgroup cols="4">
  272. <thead>
  273. <row>
  274. <entry>Option</entry>
  275. <entry>Data Type</entry>
  276. <entry>Default Value</entry>
  277. <entry>Description</entry>
  278. </row>
  279. </thead>
  280. <tbody>
  281. <row>
  282. <entry><emphasis>user</emphasis></entry>
  283. <entry><type>String</type></entry>
  284. <entry><constant>NULL</constant></entry>
  285. <entry>
  286. <filename>xcache.admin.user</filename>, necessary for the
  287. <methodname>clean()</methodname> method
  288. </entry>
  289. </row>
  290. <row>
  291. <entry><emphasis>password</emphasis></entry>
  292. <entry><type>String</type></entry>
  293. <entry><constant>NULL</constant></entry>
  294. <entry>
  295. <filename>xcache.admin.pass</filename> (in clear form, not
  296. <acronym>MD5</acronym>), necessary for the
  297. <methodname>clean()</methodname> method
  298. </entry>
  299. </row>
  300. </tbody>
  301. </tgroup>
  302. </table>
  303. </sect2>
  304. <sect2 id="zend.cache.backends.platform">
  305. <title>Zend_Cache_Backend_ZendPlatform</title>
  306. <para>
  307. This backend uses content caching <acronym>API</acronym> of the <ulink
  308. url="http://www.zend.com/en/products/platform/">Zend Platform</ulink> product.
  309. Naturally, to use this backend you need to have Zend Platform installed.
  310. </para>
  311. <para>
  312. This backend supports tags, but does not support
  313. <constant>CLEANING_MODE_NOT_MATCHING_TAG</constant> cleaning mode.
  314. </para>
  315. <para>
  316. Specify this backend using a word separator -- '-', '.', ' ', or '_'
  317. -- between the words 'Zend' and 'Platform' when using the
  318. <methodname>Zend_Cache::factory()</methodname> method:
  319. </para>
  320. <programlisting language="php"><![CDATA[
  321. $cache = Zend_Cache::factory('Core', 'Zend Platform');
  322. ]]></programlisting>
  323. <para>
  324. There are no options for this backend.
  325. </para>
  326. </sect2>
  327. <sect2 id="zend.cache.backends.twolevels">
  328. <title>Zend_Cache_Backend_TwoLevels</title>
  329. <para>
  330. This (extend) backend is an hybrid one. It stores cache records in two other backends :
  331. a fast one (but limited) like Apc, Memcache... and a "slow" one like File, Sqlite...
  332. </para>
  333. <para>
  334. This backend will use the priority parameter (given at the frontend level when storing a
  335. record) and the remaining space in the fast backend to optimize the usage of these two
  336. backends.
  337. </para>
  338. <para>
  339. Specify this backend using a word separator -- '-', '.', ' ', or '_'
  340. -- between the words 'Two' and 'Levels' when using the
  341. <methodname>Zend_Cache::factory()</methodname> method:
  342. </para>
  343. <programlisting language="php"><![CDATA[
  344. $cache = Zend_Cache::factory('Core', 'Two Levels');
  345. ]]></programlisting>
  346. <para>
  347. Available options are :
  348. </para>
  349. <table id="zend.cache.backends.twolevels.table">
  350. <title>TwoLevels Backend Options</title>
  351. <tgroup cols="4">
  352. <thead>
  353. <row>
  354. <entry>Option</entry>
  355. <entry>Data Type</entry>
  356. <entry>Default Value</entry>
  357. <entry>Description</entry>
  358. </row>
  359. </thead>
  360. <tbody>
  361. <row>
  362. <entry><emphasis>slow_backend</emphasis></entry>
  363. <entry><type>String</type></entry>
  364. <entry>File</entry>
  365. <entry>
  366. the "slow" backend name
  367. </entry>
  368. </row>
  369. <row>
  370. <entry><emphasis>fast_backend</emphasis></entry>
  371. <entry><type>String</type></entry>
  372. <entry>Apc</entry>
  373. <entry>
  374. the "fast" backend name
  375. </entry>
  376. </row>
  377. <row>
  378. <entry><emphasis>slow_backend_options</emphasis></entry>
  379. <entry><type>Array</type></entry>
  380. <entry><methodname>array()</methodname></entry>
  381. <entry>
  382. the "slow" backend options
  383. </entry>
  384. </row>
  385. <row>
  386. <entry><emphasis>fast_backend_options</emphasis></entry>
  387. <entry><type>Array</type></entry>
  388. <entry><methodname>array()</methodname></entry>
  389. <entry>
  390. the "fast" backend options
  391. </entry>
  392. </row>
  393. <row>
  394. <entry><emphasis>slow_backend_custom_naming</emphasis></entry>
  395. <entry><type>Boolean</type></entry>
  396. <entry><constant>FALSE</constant></entry>
  397. <entry>
  398. if <constant>TRUE</constant>, the slow_backend argument is used as a
  399. complete class name; if <constant>FALSE</constant>,
  400. 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>fast_backend_custom_naming</emphasis></entry>
  406. <entry><type>Boolean</type></entry>
  407. <entry><constant>FALSE</constant></entry>
  408. <entry>
  409. if <constant>TRUE</constant>, the fast_backend argument is used as a
  410. complete class name; if <constant>FALSE</constant>,
  411. the frontend argument is used as the end of
  412. "<classname>Zend_Cache_Backend_</classname>[...]" class name
  413. </entry>
  414. </row>
  415. <row>
  416. <entry><emphasis>slow_backend_autoload</emphasis></entry>
  417. <entry><type>Boolean</type></entry>
  418. <entry><constant>FALSE</constant></entry>
  419. <entry>
  420. if <constant>TRUE</constant>, there will no require_once for the
  421. slow backend (useful only for custom backends)
  422. </entry>
  423. </row>
  424. <row>
  425. <entry><emphasis>fast_backend_autoload</emphasis></entry>
  426. <entry><type>Boolean</type></entry>
  427. <entry><constant>FALSE</constant></entry>
  428. <entry>
  429. if <constant>TRUE</constant>, there will no require_once for the fast
  430. backend (useful only for custom backends)
  431. </entry>
  432. </row>
  433. <row>
  434. <entry><emphasis>auto_refresh_fast_cache</emphasis></entry>
  435. <entry><type>Boolean</type></entry>
  436. <entry><constant>TRUE</constant></entry>
  437. <entry>
  438. if <constant>TRUE</constant>, auto refresh the fast cache when a
  439. cache record is hit
  440. </entry>
  441. </row>
  442. <row>
  443. <entry><emphasis>stats_update_factor</emphasis></entry>
  444. <entry><type>Integer</type></entry>
  445. <entry>10</entry>
  446. <entry>
  447. disable / tune the computation of the fast backend filling percentage
  448. (when saving a record into cache, computation of the fast backend
  449. filling percentage randomly 1 times on x cache writes)
  450. </entry>
  451. </row>
  452. </tbody>
  453. </tgroup>
  454. </table>
  455. </sect2>
  456. <sect2 id="zend.cache.backends.zendserver">
  457. <title>Zend_Cache_Backend_ZendServer_Disk and Zend_Cache_Backend_ZendServer_ShMem</title>
  458. <para>
  459. These backends store cache records using <ulink
  460. url="http://www.zend.com/en/products/server/downloads-all?zfs=zf_download">Zend
  461. Server</ulink> caching functionality.
  462. </para>
  463. <para>
  464. Be careful: with these backends, "tags" are not supported for the moment as the
  465. "doNotTestCacheValidity=true" argument.
  466. </para>
  467. <para>
  468. These backend work only withing Zend Server environment for pages requested through
  469. <acronym>HTTP</acronym> or <acronym>HTTPS</acronym> and don't work for command line
  470. script execution
  471. </para>
  472. <para>
  473. Specify this backend using parameter <emphasis>customBackendNaming</emphasis> as
  474. <constant>TRUE</constant> when using the <methodname>Zend_Cache::factory()</methodname>
  475. method:
  476. </para>
  477. <programlisting language="php"><![CDATA[
  478. $cache = Zend_Cache::factory('Core', 'Zend_Cache_Backend_ZendServer_Disk',
  479. $frontendOptions, $backendOptions, false, true);
  480. ]]></programlisting>
  481. <para>
  482. There is no option for this backend.
  483. </para>
  484. </sect2>
  485. <sect2 id="zend.cache.backends.static">
  486. <title>Zend_Cache_Backend_Static</title>
  487. <para>
  488. This backend works in concert with <classname>
  489. Zend_Cache_Frontend_Capture</classname> (the two must be used
  490. together) to save the output from requests as static files. This
  491. means the static files are served directly on subsequent requests
  492. without any involvement of PHP or the Zend Framework at all.
  493. </para>
  494. <para>
  495. The benefits of this cache include a large throughput increase since
  496. all subsequent requests return the static file and don't need any
  497. dynamic processing. Of course this also has some disadvantages. The
  498. only way to retry the dynamic request is to purge the cached file
  499. from elsewhere in the application (or via a cronjob if timed). It
  500. is also restricted to single-server applications where only one
  501. filesystem is used. Nevertheless, it can be a powerful means of
  502. getting more performance without incurring the cost of a proxy on
  503. single machines.
  504. </para>
  505. <para>
  506. Before describing its options, you should note this needs some
  507. changes to the default .htaccess file in order for requests to be
  508. directed to the static files if they exist. Here's an example of
  509. a simple application caching some content, including two specific
  510. feeds which need additional treatment to serve a correct
  511. Content-Type header:
  512. </para>
  513. <programlisting language="text"><![CDATA[
  514. AddType application/rss+xml .xml
  515. AddType application/atom+xml .xml
  516. RewriteEngine On
  517. RewriteCond %{REQUEST_URI} feed/rss$
  518. RewriteCond %{DOCUMENT_ROOT}/cached/%{REQUEST_URI}.xml -f
  519. RewriteRule .* cached/%{REQUEST_URI}.xml [L,T=application/rss+xml]
  520. RewriteCond %{REQUEST_URI} feed/atom$
  521. RewriteCond %{DOCUMENT_ROOT}/cached/%{REQUEST_URI}.xml -f
  522. RewriteRule .* cached/%{REQUEST_URI}.xml [L,T=application/atom+xml]
  523. RewriteCond %{DOCUMENT_ROOT}/cached/%{REQUEST_URI}.(html|xml|json|opml|svg) -f
  524. RewriteRule .* cached/%{REQUEST_URI}.%1 [L]
  525. RewriteCond %{REQUEST_FILENAME} -s [OR]
  526. RewriteCond %{REQUEST_FILENAME} -l [OR]
  527. RewriteCond %{REQUEST_FILENAME} -d
  528. RewriteRule ^.*$ - [NC,L]
  529. RewriteRule ^.*$ index.php [NC,L]
  530. ]]></programlisting>
  531. <para>
  532. The above assumes static files are cached to the directory ./public/cached.
  533. We'll cover the option setting this location, "public_dir", below.
  534. </para>
  535. <para>
  536. Due to the nature of static file caching, the backend class offers two
  537. additional methods: <methodname>remove()</methodname> and <methodname>
  538. removeRecursively()</methodname>. Both accept a request URI, which when
  539. mapped to the "public_dir" where static files are cached, and has a
  540. pre-stored extension appended, provides the name of either a static
  541. file to delete, or a directory path to delete recursively. Due to the
  542. restraints of <classname>Zend_Cache_Backend_Interface</classname>, all
  543. other methods such as <classname>save()</classname> accept an ID which
  544. is calculated by applying bin2hex() to a request URI.
  545. </para>
  546. <para>
  547. Given the level at which static caching operates, static file caching
  548. is addressed for simpler use with the <classname>
  549. Zend_Controller_Action_Helper_Cache</classname> action helper. This helper
  550. assists in setting which actions of a controller to cache, with what tags,
  551. and with which extension. It also offers methods for purging the cache by
  552. request URI or tag. Static file caching is also assisted by <classname>
  553. Zend_Cache_Manager</classname> which includes pre-configured configuration
  554. templates for a static cache (as Zend_Cache_Manager::PAGECACHE or "page").
  555. The defaults therein can be configured as needed to set up a "public_dir"
  556. location for caching, etc.
  557. </para>
  558. <note>
  559. <para>
  560. It should be noted that the static cache actually uses a secondary
  561. cache to store tags (obviously we can't store them elsewhere since
  562. a static cache does not invoke PHP if working correctly). This is
  563. just a standard Core cache, and should use a persistent backend such
  564. as File or TwoLevels (to take advantage of memory storage without
  565. sacrificing permanent persistance). The backend includes the option
  566. "tag_cache" to set this up (it is obligatory), or the <methodname>
  567. setInnerCache()</methodname> method.
  568. </para>
  569. </note>
  570. <table id="zend.cache.backends.static.table">
  571. <title>Static Backend Options</title>
  572. <tgroup cols="4">
  573. <thead>
  574. <row>
  575. <entry>Option</entry>
  576. <entry>Data Type</entry>
  577. <entry>Default Value</entry>
  578. <entry>Description</entry>
  579. </row>
  580. </thead>
  581. <tbody>
  582. <row>
  583. <entry><emphasis>public_dir</emphasis></entry>
  584. <entry><type>String</type></entry>
  585. <entry>NULL</entry>
  586. <entry>
  587. Directory where to store static files. This must exist
  588. in your public directory.
  589. </entry>
  590. </row>
  591. <row>
  592. <entry><emphasis>file_locking</emphasis></entry>
  593. <entry><type>Boolean</type></entry>
  594. <entry><constant>TRUE</constant></entry>
  595. <entry>
  596. Enable or disable file_locking : Can avoid cache corruption under
  597. bad circumstances but it doesn't help on multithread webservers
  598. or on <acronym>NFS</acronym> filesystems...
  599. </entry>
  600. </row>
  601. <row>
  602. <entry><emphasis>read_control</emphasis></entry>
  603. <entry><type>Boolean</type></entry>
  604. <entry><constant>TRUE</constant></entry>
  605. <entry>
  606. Enable / disable read control : if enabled, a control key is
  607. embedded in the cache file and this key is compared with the
  608. one calculated after the reading.
  609. </entry>
  610. </row>
  611. <row>
  612. <entry><emphasis>read_control_type</emphasis></entry>
  613. <entry><type>String</type></entry>
  614. <entry>'crc32'</entry>
  615. <entry>
  616. Type of read control (only if read control is enabled). Available values
  617. are : 'md5' (best but slowest), 'crc32' (lightly less safe but faster,
  618. better choice), 'adler32' (new choice, faster than crc32),
  619. 'strlen' for a length only test (fastest).
  620. </entry>
  621. </row>
  622. <row>
  623. <entry><emphasis>cache_file_umask</emphasis></entry>
  624. <entry><type>Integer</type></entry>
  625. <entry>0700</entry>
  626. <entry>
  627. umask for cached files.
  628. </entry>
  629. </row>
  630. <row>
  631. <entry><emphasis>cache_directory_umask</emphasis></entry>
  632. <entry><type>Integer</type></entry>
  633. <entry>0700</entry>
  634. <entry>
  635. Umask for directories created within public_dir.
  636. </entry>
  637. </row>
  638. <row>
  639. <entry><emphasis>file_extension</emphasis></entry>
  640. <entry><type>String</type></entry>
  641. <entry>'.html'</entry>
  642. <entry>
  643. Default file extension for static files created. This
  644. can be configured on the fly, see <methodname>
  645. Zend_Cache_Backend_Static::save()</methodname> though
  646. generally it's recommended to rely on <classname>
  647. Zend_Controller_Action_Helper_Cache</classname> when
  648. doing so since it's simpler that way than messing with
  649. arrays/serialization manually.
  650. </entry>
  651. </row>
  652. <row>
  653. <entry><emphasis>index_filename</emphasis></entry>
  654. <entry><type>String</type></entry>
  655. <entry>'index'</entry>
  656. <entry>
  657. If a request URI does not contain sufficient information
  658. to construct a static file (usually this means an index
  659. call, e.g. URI of '/'), the index_filename is used instead.
  660. So '' or '/' would map to 'index.html' (assuming the default
  661. file_extension is '.html').
  662. </entry>
  663. </row>
  664. <row>
  665. <entry><emphasis>tag_cache</emphasis></entry>
  666. <entry><type>Object</type></entry>
  667. <entry>NULL</entry>
  668. <entry>
  669. Used to set an 'inner' cache utilised to store tags
  670. and file extensions associated with static files. This
  671. MUST be set or the static cache cannot be tracked and
  672. managed.
  673. </entry>
  674. </row>
  675. <row>
  676. <entry><emphasis>disable_caching</emphasis></entry>
  677. <entry><type>Boolean</type></entry>
  678. <entry>FALSE</entry>
  679. <entry>
  680. If set to TRUE, static files will not be cached. This
  681. will force all requests to be dynamic even if marked
  682. to be cached in Controllers. Useful for debugging.
  683. </entry>
  684. </row>
  685. </tbody>
  686. </tgroup>
  687. </table>
  688. </sect2>
  689. </sect1>
  690. <!--
  691. vim:se ts=4 sw=4 et:
  692. -->