Zend_Cache-Backends.xml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <!-- EN-Revision: 15207 -->
  4. <sect1 id="zend.cache.backends">
  5. <title><classname>Zend_Cache</classname> のバックエンド</title>
  6. <para>
  7. バックエンドには、標準と拡張の 2 種類があります。
  8. もちろん、拡張バックエンドのほうがより高機能となります。
  9. </para>
  10. <sect2 id="zend.cache.backends.file">
  11. <title>Zend_Cache_Backend_File</title>
  12. <para>
  13. この (拡張) バックエンドは、キャッシュレコードを
  14. (指定したディレクトリの) ファイルに保存します。
  15. </para>
  16. <para>
  17. 使用可能なオプションは次のとおりです。
  18. </para>
  19. <table id="zend.cache.backends.file.table">
  20. <title>File バックエンドのオプション</title>
  21. <tgroup cols="4">
  22. <thead>
  23. <row>
  24. <entry>オプション</entry>
  25. <entry>データ型</entry>
  26. <entry>デフォルト値</entry>
  27. <entry>説明</entry>
  28. </row>
  29. </thead>
  30. <tbody>
  31. <row>
  32. <entry><code>cache_dir</code></entry>
  33. <entry><code>string</code></entry>
  34. <entry><code>'/tmp/'</code></entry>
  35. <entry>
  36. キャッシュファイルを書き込むディレクトリ。
  37. </entry>
  38. </row>
  39. <row>
  40. <entry><code>file_locking</code></entry>
  41. <entry><code>boolean</code></entry>
  42. <entry><code>true</code></entry>
  43. <entry>
  44. ファイルロックを有効/無効にします。
  45. 不慮の事故でキャッシュが破壊されることを防げますが、
  46. マルチスレッドなウェブサーバ環境や NFS ファイルシステム上では役に立ちません。
  47. </entry>
  48. </row>
  49. <row>
  50. <entry><code>read_control</code></entry>
  51. <entry><code>boolean</code></entry>
  52. <entry><code>true</code></entry>
  53. <entry>
  54. 読み込み制御を有効/無効にします。有効にすると
  55. キャッシュファイルに制御キーが埋め込まれます。
  56. キャッシュの読み込み後、計算した結果とキャッシュのキーを比較します。
  57. </entry>
  58. </row>
  59. <row>
  60. <entry><code>read_control_type</code></entry>
  61. <entry><code>string</code></entry>
  62. <entry><code>'crc32'</code></entry>
  63. <entry>
  64. 読み込み制御の方式 (読み込み制御が有効な場合にのみ使用します)。
  65. 使用可能な値は
  66. 'md5' (一番安全だが、最も遅い)、
  67. 'crc32' (安全性には劣るが、より高速。悪くない選択肢です)、
  68. 'adler32' (新たな選択肢。crc32 より高速です)、
  69. 'strlen' (最も高速。長さのみをチェックします)
  70. のいずれかです。
  71. </entry>
  72. </row>
  73. <row>
  74. <entry><code>hashed_directory_level</code></entry>
  75. <entry><code>int</code></entry>
  76. <entry><code>0</code></entry>
  77. <entry>
  78. ディレクトリ構造のレベルを指定します。0 は "ディレクトリ階層を作らない"、
  79. 1 は "一段階のサブディレクトリを作る"、2 は "二段階の……" を意味します。
  80. 何千ものキャッシュファイルを使用する場合にのみ、
  81. このオプションによる高速化を実感できるでしょう。
  82. 適切な設定値を決めるには、実際にベンチマークを取得するしかありません。
  83. たいていの場合は 1 または 2 でよいでしょう。
  84. </entry>
  85. </row>
  86. <row>
  87. <entry><code>hashed_directory_umask</code></entry>
  88. <entry><code>int</code></entry>
  89. <entry><code>0700</code></entry>
  90. <entry>
  91. ディレクトリ構造の umask を指定します。
  92. </entry>
  93. </row>
  94. <row>
  95. <entry><code>file_name_prefix</code></entry>
  96. <entry><code>string</code></entry>
  97. <entry><code>'zend_cache'</code></entry>
  98. <entry>
  99. キャッシュファイルのプレフィックスを設定します。
  100. このオプションを設定する際には十分注意しましょう。
  101. あまりにもありふれた値をシステムのキャッシュディレクトリ
  102. (/tmp など) で使用すると、
  103. キャッシュの削除の際に余計なものまで削除されてしまうはめになります。
  104. </entry>
  105. </row>
  106. <row>
  107. <entry><code>cache_file_umask</code></entry>
  108. <entry><code>int</code></entry>
  109. <entry><code>0700</code></entry>
  110. <entry>
  111. キャッシュファイルの umask を設定します。
  112. </entry>
  113. </row>
  114. <row>
  115. <entry><code>metatadatas_array_max_size</code></entry>
  116. <entry><code>int</code></entry>
  117. <entry><code>100</code></entry>
  118. <entry>
  119. メタデータ配列の内部最大サイズを設定します
  120. (よくわからない場合はこの値を変更してはいけません)。
  121. </entry>
  122. </row>
  123. </tbody>
  124. </tgroup>
  125. </table>
  126. </sect2>
  127. <sect2 id="zend.cache.backends.sqlite">
  128. <title>Zend_Cache_Backend_Sqlite</title>
  129. <para>
  130. この (拡張) バックエンドは、キャッシュレコードを
  131. SQLite データベースに保存します。
  132. </para>
  133. <para>
  134. 使用可能なオプションは次のとおりです。
  135. </para>
  136. <table id="zend.cache.backends.sqlite.table">
  137. <title>Sqlite バックエンドのオプション</title>
  138. <tgroup cols="4">
  139. <thead>
  140. <row>
  141. <entry>オプション</entry>
  142. <entry>データ型</entry>
  143. <entry>デフォルト値</entry>
  144. <entry>説明</entry>
  145. </row>
  146. </thead>
  147. <tbody>
  148. <row>
  149. <entry><code>cache_db_complete_path (必須)</code></entry>
  150. <entry><code>string</code></entry>
  151. <entry><code>null</code></entry>
  152. <entry>
  153. SQLite データベースへの (ファイル名も含めた) フルパス。
  154. </entry>
  155. </row>
  156. <row>
  157. <entry><code>automatic_vacuum_factor</code></entry>
  158. <entry><code>int</code></entry>
  159. <entry><code>10</code></entry>
  160. <entry>
  161. 自動バキューム処理の設定を行います。
  162. 自動バキューム処理とは、clean() や delete()
  163. がコールされた際に自動的にデータベースの断片化解消を行う
  164. (そしてサイズを縮小する) ことです。
  165. 0 を指定すると、自動バキュームを行いません。
  166. 1 を指定すると (delete() や clean() がコールされると) そのたびにバキュームを行います。
  167. x (1 より大きな整数) を指定すると、
  168. clean() や delete() が x 回コールされるたびに
  169. 一回の頻度でランダムに自動バキュームを行います。
  170. </entry>
  171. </row>
  172. </tbody>
  173. </tgroup>
  174. </table>
  175. </sect2>
  176. <sect2 id="zend.cache.backends.memcached">
  177. <title>Zend_Cache_Backend_Memcached</title>
  178. <para>
  179. この (拡張) バックエンドは、キャッシュレコードを memcached サーバに保存します。
  180. <ulink url="http://www.danga.com/memcached/">memcached</ulink> は、
  181. 高性能な分散メモリオブジェクトキャッシュシステムです。このバックエンドを使用するには、
  182. memcached デーモンおよび
  183. <ulink url="http://pecl.php.net/package/memcache">memcache PECL 拡張モジュール</ulink>
  184. が必要です。
  185. </para>
  186. <para>
  187. 注意: このバックエンドでは、今のところ "タグ" がサポートされていません。
  188. また、引数 "doNotTestCacheValidity=true" もサポートされていません。
  189. </para>
  190. <para>
  191. 使用可能なオプションは次のとおりです。
  192. </para>
  193. <table id="zend.cache.backends.memcached.table">
  194. <title>Memcached バックエンドのオプション</title>
  195. <tgroup cols="4">
  196. <thead>
  197. <row>
  198. <entry>オプション</entry>
  199. <entry>データ型</entry>
  200. <entry>デフォルト値</entry>
  201. <entry>説明</entry>
  202. </row>
  203. </thead>
  204. <tbody>
  205. <row>
  206. <entry><code>servers</code></entry>
  207. <entry><code>array</code></entry>
  208. <entry>
  209. <code>
  210. array(array('host' => 'localhost', 'port' => 11211, 'persistent' => true, 'weight' => 1,
  211. 'timeout' => 5, 'retry_interval' => 15, 'status' => true, 'failure_callback' => '' ))
  212. </code>
  213. </entry>
  214. <entry>
  215. memcached サーバの配列です。各 memcached サーバの情報は、
  216. 以下のような連想配列で指定します。
  217. 'host' => (string) : memcached サーバのサーバ名
  218. 'port' => (int) : memcached サーバのポート番号
  219. 'persistent' => (bool) : この memcached サーバに対して持続的な接続を使用するかどうか
  220. 'weight' => (int) : memcached サーバの重み付け
  221. 'timeout' => (int) : memcached サーバのタイムアウト
  222. 'retry_interval' => (int) : memcached サーバの再試行間隔
  223. 'status' => (bool) : memcached サーバのステータス
  224. 'failure_callback' => (callback) : memcached サーバのコールバック関数
  225. </entry>
  226. </row>
  227. <row>
  228. <entry><code>compression</code></entry>
  229. <entry><code>boolean</code></entry>
  230. <entry><code>false</code></entry>
  231. <entry>
  232. その場での圧縮処理を行いたい場合に true を指定します。
  233. </entry>
  234. </row>
  235. <row>
  236. <entry><code>compatibility</code></entry>
  237. <entry><code>boolean</code></entry>
  238. <entry><code>false</code></entry>
  239. <entry>
  240. 古い memcache サーバ/拡張モジュールとの互換性モードを使用したい場合に
  241. true を指定します。
  242. </entry>
  243. </row>
  244. </tbody>
  245. </tgroup>
  246. </table>
  247. </sect2>
  248. <sect2 id="zend.cache.backends.apc">
  249. <title>Zend_Cache_Backend_Apc</title>
  250. <para>
  251. この (拡張) バックエンドは、キャッシュレコードを共有メモリに保存する際に
  252. <ulink url="http://pecl.php.net/package/APC">APC</ulink> (Alternative PHP Cache)
  253. 拡張モジュールを使用します
  254. (当然、このバックエンドを使用するにはこの拡張モジュールが必要です)。
  255. </para>
  256. <para>
  257. 注意: このバックエンドでは、今のところ "タグ" がサポートされていません。
  258. また、引数 "doNotTestCacheValidity=true" もサポートされていません。
  259. </para>
  260. <para>
  261. このバックエンドではオプションを使用しません。
  262. </para>
  263. </sect2>
  264. <sect2 id="zend.cache.backends.xcache">
  265. <title>Zend_Cache_Backend_Xcache</title>
  266. <para>
  267. このバックエンドは、キャッシュレコードを共有メモリに保存する際に
  268. <ulink url="http://xcache.lighttpd.net/">XCache</ulink>
  269. 拡張モジュールを使用します
  270. (当然、このバックエンドを使うにはこの拡張モジュールが必要となります)。
  271. </para>
  272. <para>
  273. 注意: このバックエンドでは、今のところ "タグ" がサポートされていません。
  274. また、引数 "doNotTestCacheValidity=true" もサポートされていません。
  275. </para>
  276. <para>
  277. 使用可能なオプションは次のとおりです。
  278. </para>
  279. <table id="zend.cache.backends.xcache.table">
  280. <title>Xcache バックエンドのオプション</title>
  281. <tgroup cols="4">
  282. <thead>
  283. <row>
  284. <entry>オプション</entry>
  285. <entry>データ型</entry>
  286. <entry>デフォルト値</entry>
  287. <entry>説明</entry>
  288. </row>
  289. </thead>
  290. <tbody>
  291. <row>
  292. <entry><code>user</code></entry>
  293. <entry><code>string</code></entry>
  294. <entry><code>null</code></entry>
  295. <entry>
  296. xcache.admin.user です。clean() メソッドを使う際に必要です。
  297. </entry>
  298. </row>
  299. <row>
  300. <entry><code>password</code></entry>
  301. <entry><code>string</code></entry>
  302. <entry><code>null</code></entry>
  303. <entry>
  304. xcache.admin.pass (MD5 ではない平文形式) です。
  305. clean() メソッドを使う際に必要です。
  306. </entry>
  307. </row>
  308. </tbody>
  309. </tgroup>
  310. </table>
  311. </sect2>
  312. <sect2 id="zend.cache.backends.platform">
  313. <title>Zend_Cache_Backend_ZendPlatform</title>
  314. <para>
  315. このバックエンドは、<ulink url="http://www.zend.com/products/platform">Zend Platform</ulink>
  316. 製品のコンテンツキャッシング API を使用します。当然、このバックエンドを使用するには
  317. Zend Platform をインストールする必要があります。
  318. </para>
  319. <para>
  320. このバックエンドはタグをサポートしています。しかし、
  321. クリーニングモード <code>CLEANING_MODE_NOT_MATCHING_TAG</code> はサポートしていません。
  322. </para>
  323. <para>
  324. <classname>Zend_Cache::factory()</classname> メソッドでこのバックエンドを指定する場合は、
  325. 'Zend' と 'Platform' の間に区切り文字を入れます。区切り文字としては
  326. '-'、'.'、' ' あるいは '_' が使用できます。
  327. </para>
  328. <programlisting role="php"><![CDATA[
  329. $cache = Zend_Cache::factory('Core', 'Zend Platform');
  330. ]]></programlisting>
  331. <para>
  332. このバックエンドではオプションを使用しません。
  333. </para>
  334. </sect2>
  335. <sect2 id="zend.cache.backends.twolevels">
  336. <title>Zend_Cache_Backend_TwoLevels</title>
  337. <para>
  338. この (拡張) バックエンドは複合型です。
  339. キャッシュレコードを、
  340. 高速 (だが制限付き) な Apc、Memcache…… および "低速"
  341. な File、Sqlite…… の 2 種類の別々のバックエンドに格納します。
  342. </para>
  343. <para>
  344. このバックエンドは priority パラメータを使用 (フロントエンドレベルで、記録開始時に指定)
  345. し、高速バックエンドの残りのスペースを用いてふたつのバックエンドの使用を最適化します。
  346. FIXME
  347. </para>
  348. <para>
  349. 使用可能なオプションは次のとおりです。
  350. </para>
  351. <table id="zend.cache.backends.twolevels.table">
  352. <title>TwoLevels バックエンドのオプション</title>
  353. <tgroup cols="4">
  354. <thead>
  355. <row>
  356. <entry>オプション</entry>
  357. <entry>データ型</entry>
  358. <entry>デフォルト値</entry>
  359. <entry>説明</entry>
  360. </row>
  361. </thead>
  362. <tbody>
  363. <row>
  364. <entry><code>slow_backend</code></entry>
  365. <entry><code>string</code></entry>
  366. <entry><code>File</code></entry>
  367. <entry>
  368. "低速" バックエンドの名前。
  369. </entry>
  370. </row>
  371. <row>
  372. <entry><code>fast_backend</code></entry>
  373. <entry><code>string</code></entry>
  374. <entry><code>Apc</code></entry>
  375. <entry>
  376. "高速" バックエンドの名前。
  377. </entry>
  378. </row>
  379. <row>
  380. <entry><code>slow_backend_options</code></entry>
  381. <entry><code>array</code></entry>
  382. <entry><code>array()</code></entry>
  383. <entry>
  384. "低速" バックエンドのオプション。
  385. </entry>
  386. </row>
  387. <row>
  388. <entry><code>fast_backend_options</code></entry>
  389. <entry><code>array</code></entry>
  390. <entry><code>array()</code></entry>
  391. <entry>
  392. "高速" バックエンドのオプション。
  393. </entry>
  394. </row>
  395. <row>
  396. <entry><code>slow_backend_custom_naming</code></entry>
  397. <entry><code>boolean</code></entry>
  398. <entry><code>false</code></entry>
  399. <entry>
  400. true の場合は、引数 slow_backend を完全なクラス名として使用します。
  401. false の場合は、引数をクラス名 "Zend_Cache_Backend_[...]"
  402. の最後の部分として使用します。
  403. </entry>
  404. </row>
  405. <row>
  406. <entry><code>fast_backend_custom_naming</code></entry>
  407. <entry><code>boolean</code></entry>
  408. <entry><code>false</code></entry>
  409. <entry>
  410. true の場合は、引数 fast_backend を完全なクラス名として使用します。
  411. false の場合は、引数をクラス名 "Zend_Cache_Backend_[...]"
  412. の最後の部分として使用します。
  413. </entry>
  414. </row>
  415. <row>
  416. <entry><code>slow_backend_autoload</code></entry>
  417. <entry><code>boolean</code></entry>
  418. <entry><code>false</code></entry>
  419. <entry>
  420. true の場合は、低速バックエンドに対して require_once を行いません
  421. (独自のバックエンドを使用する場合にのみ有用です)。
  422. </entry>
  423. </row>
  424. <row>
  425. <entry><code>fast_backend_autoload</code></entry>
  426. <entry><code>boolean</code></entry>
  427. <entry><code>false</code></entry>
  428. <entry>
  429. true の場合は、高速バックエンドに対して require_once を行いません
  430. (独自のバックエンドを使用する場合にのみ有用です)。
  431. </entry>
  432. </row>
  433. <row>
  434. <entry><code>auto_refresh_fast_cache</code></entry>
  435. <entry><code>boolean</code></entry>
  436. <entry><code>true</code></entry>
  437. <entry>
  438. true の場合は、キャッシュレコードにヒットしたときに
  439. 高速キャッシュを自動的にリフレッシュします。
  440. </entry>
  441. </row>
  442. <row>
  443. <entry><code>stats_update_factor</code></entry>
  444. <entry><code>integer</code></entry>
  445. <entry><code>10</code></entry>
  446. <entry>
  447. 高速バックエンドを使用率の計算を無効化 / 効率化します
  448. (レコードをキャッシュに書き込む際の
  449. 高速バックエンド使用率の計算は、
  450. キャッシュ書き込み x 回につき 1 回の割合でランダムに行われます)。
  451. </entry>
  452. </row>
  453. </tbody>
  454. </tgroup>
  455. </table>
  456. </sect2>
  457. <sect2 id="zend.cache.backends.zendserver">
  458. <title>Zend_Cache_Backend_ZendServer_Disk および Zend_Cache_Backend_ZendServer_ShMem</title>
  459. <para>
  460. これらのバックエンドは、キャッシュレコードの保存に
  461. <ulink url="http://www.zend.com/en/products/server/downloads-all?zfs=zf_download">Zend Server</ulink>
  462. のキャッシュ機能を使用します。
  463. </para>
  464. <para>
  465. 注意: このバックエンドでは、今のところ "タグ" がサポートされていません。
  466. また、引数 "doNotTestCacheValidity=true" もサポートされていません。
  467. </para>
  468. <para>
  469. これらのバックエンドが動作するのは、Zend Server 環境で
  470. HTTP(S) 越しにページをリクエストした場合のみです。
  471. コマンドラインでスクリプトを実行した場合は動作しません。
  472. </para>
  473. <para>
  474. このバックエンドにはオプションはありません。
  475. </para>
  476. </sect2>
  477. </sect1>
  478. <!--
  479. vim:se ts=4 sw=4 et:
  480. -->