Zend_Cache-Backends.xml 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <!-- EN-Revision: 15740 -->
  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><emphasis>cache_dir</emphasis></entry>
  33. <entry><type>String</type></entry>
  34. <entry><filename>'/tmp/'</filename></entry>
  35. <entry>
  36. キャッシュファイルを書き込むディレクトリ。
  37. </entry>
  38. </row>
  39. <row>
  40. <entry><emphasis>file_locking</emphasis></entry>
  41. <entry><type>Boolean</type></entry>
  42. <entry><constant>TRUE</constant></entry>
  43. <entry>
  44. ファイルロックを有効/無効にします。
  45. 不慮の事故でキャッシュが破壊されることを防げますが、
  46. マルチスレッドなウェブサーバ環境や NFS ファイルシステム上では役に立ちません。
  47. </entry>
  48. </row>
  49. <row>
  50. <entry><emphasis>read_control</emphasis></entry>
  51. <entry><type>Boolean</type></entry>
  52. <entry><constant>TRUE</constant></entry>
  53. <entry>
  54. 読み込み制御を有効/無効にします。有効にすると
  55. キャッシュファイルに制御キーが埋め込まれます。
  56. キャッシュの読み込み後、計算した結果とキャッシュのキーを比較します。
  57. </entry>
  58. </row>
  59. <row>
  60. <entry><emphasis>read_control_type</emphasis></entry>
  61. <entry><type>String</type></entry>
  62. <entry>'crc32'</entry>
  63. <entry>
  64. 読み込み制御の方式 (読み込み制御が有効な場合にのみ使用します)。
  65. 使用可能な値は
  66. 'md5' (一番安全だが、最も遅い)、
  67. 'crc32' (安全性には劣るが、より高速。悪くない選択肢です)、
  68. 'adler32' (新たな選択肢。crc32 より高速です)、
  69. 'strlen' (最も高速。長さのみをチェックします)
  70. のいずれかです。
  71. </entry>
  72. </row>
  73. <row>
  74. <entry><emphasis>hashed_directory_level</emphasis></entry>
  75. <entry><type>Integer</type></entry>
  76. <entry>0</entry>
  77. <entry>
  78. ディレクトリ構造のレベルを指定します。0 は "ディレクトリ階層を作らない"、
  79. 1 は "一段階のサブディレクトリを作る"、2 は "二段階の……" を意味します。
  80. 何千ものキャッシュファイルを使用する場合にのみ、
  81. このオプションによる高速化を実感できるでしょう。
  82. 適切な設定値を決めるには、実際にベンチマークを取得するしかありません。
  83. たいていの場合は 1 または 2 でよいでしょう。
  84. </entry>
  85. </row>
  86. <row>
  87. <entry><emphasis>hashed_directory_umask</emphasis></entry>
  88. <entry><type>Integer</type></entry>
  89. <entry>0700</entry>
  90. <entry>
  91. ディレクトリ構造の umask を指定します。
  92. </entry>
  93. </row>
  94. <row>
  95. <entry><emphasis>file_name_prefix</emphasis></entry>
  96. <entry><type>String</type></entry>
  97. <entry>'zend_cache'</entry>
  98. <entry>
  99. キャッシュファイルのプレフィックスを設定します。
  100. このオプションを設定する際には十分注意しましょう。
  101. あまりにもありふれた値をシステムのキャッシュディレクトリ
  102. (/tmp など) で使用すると、
  103. キャッシュの削除の際に余計なものまで削除されてしまうはめになります。
  104. </entry>
  105. </row>
  106. <row>
  107. <entry><emphasis>cache_file_umask</emphasis></entry>
  108. <entry><type>Integer</type></entry>
  109. <entry>0700</entry>
  110. <entry>
  111. キャッシュファイルの umask を設定します。
  112. </entry>
  113. </row>
  114. <row>
  115. <entry><emphasis>metatadatas_array_max_size</emphasis></entry>
  116. <entry><type>Integer</type></entry>
  117. <entry>100</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><emphasis>cache_db_complete_path (必須)</emphasis></entry>
  150. <entry><type>String</type></entry>
  151. <entry><constant>NULL</constant></entry>
  152. <entry>
  153. SQLite データベースへの (ファイル名も含めた) フルパス。
  154. </entry>
  155. </row>
  156. <row>
  157. <entry><emphasis>automatic_vacuum_factor</emphasis></entry>
  158. <entry><type>Integer</type></entry>
  159. <entry>10</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><emphasis>servers</emphasis></entry>
  207. <entry><type>Array</type></entry>
  208. <entry>
  209. array(array('host' => 'localhost', 'port' => 11211, 'persistent' => true, 'weight' => 1,
  210. 'timeout' => 5, 'retry_interval' => 15, 'status' => true, 'failure_callback' => '' ))
  211. </entry>
  212. <entry>
  213. memcached サーバの配列です。各 memcached サーバの情報は、
  214. 以下のような連想配列で指定します。
  215. 'host' => (string) : memcached サーバのサーバ名
  216. 'port' => (int) : memcached サーバのポート番号
  217. 'persistent' => (bool) : この memcached サーバに対して持続的な接続を使用するかどうか
  218. 'weight' => (int) : memcached サーバの重み付け
  219. 'timeout' => (int) : memcached サーバのタイムアウト
  220. 'retry_interval' => (int) : memcached サーバの再試行間隔
  221. 'status' => (bool) : memcached サーバのステータス
  222. 'failure_callback' => (callback) : memcached サーバのコールバック関数
  223. </entry>
  224. </row>
  225. <row>
  226. <entry><emphasis>compression</emphasis></entry>
  227. <entry><type>Boolean</type></entry>
  228. <entry><constant>FALSE</constant></entry>
  229. <entry>
  230. その場での圧縮処理を行いたい場合に true を指定します。
  231. </entry>
  232. </row>
  233. <row>
  234. <entry><emphasis>compatibility</emphasis></entry>
  235. <entry><type>Boolean</type></entry>
  236. <entry><constant>FALSE</constant></entry>
  237. <entry>
  238. 古い memcache サーバ/拡張モジュールとの互換性モードを使用したい場合に
  239. true を指定します。
  240. </entry>
  241. </row>
  242. </tbody>
  243. </tgroup>
  244. </table>
  245. </sect2>
  246. <sect2 id="zend.cache.backends.apc">
  247. <title>Zend_Cache_Backend_Apc</title>
  248. <para>
  249. この (拡張) バックエンドは、キャッシュレコードを共有メモリに保存する際に
  250. <ulink url="http://pecl.php.net/package/APC">APC</ulink> (Alternative PHP Cache)
  251. 拡張モジュールを使用します
  252. (当然、このバックエンドを使用するにはこの拡張モジュールが必要です)。
  253. </para>
  254. <para>
  255. 注意: このバックエンドでは、今のところ "タグ" がサポートされていません。
  256. また、引数 "doNotTestCacheValidity=true" もサポートされていません。
  257. </para>
  258. <para>
  259. このバックエンドではオプションを使用しません。
  260. </para>
  261. </sect2>
  262. <sect2 id="zend.cache.backends.xcache">
  263. <title>Zend_Cache_Backend_Xcache</title>
  264. <para>
  265. このバックエンドは、キャッシュレコードを共有メモリに保存する際に
  266. <ulink url="http://xcache.lighttpd.net/">XCache</ulink>
  267. 拡張モジュールを使用します
  268. (当然、このバックエンドを使うにはこの拡張モジュールが必要となります)。
  269. </para>
  270. <para>
  271. 注意: このバックエンドでは、今のところ "タグ" がサポートされていません。
  272. また、引数 "doNotTestCacheValidity=true" もサポートされていません。
  273. </para>
  274. <para>
  275. 使用可能なオプションは次のとおりです。
  276. </para>
  277. <table id="zend.cache.backends.xcache.table">
  278. <title>Xcache バックエンドのオプション</title>
  279. <tgroup cols="4">
  280. <thead>
  281. <row>
  282. <entry>オプション</entry>
  283. <entry>データ型</entry>
  284. <entry>デフォルト値</entry>
  285. <entry>説明</entry>
  286. </row>
  287. </thead>
  288. <tbody>
  289. <row>
  290. <entry><emphasis>user</emphasis></entry>
  291. <entry><type>String</type></entry>
  292. <entry><constant>NULL</constant></entry>
  293. <entry>
  294. xcache.admin.user です。clean() メソッドを使う際に必要です。
  295. </entry>
  296. </row>
  297. <row>
  298. <entry><emphasis>password</emphasis></entry>
  299. <entry><type>String</type></entry>
  300. <entry><constant>NULL</constant></entry>
  301. <entry>
  302. xcache.admin.pass (MD5 ではない平文形式) です。
  303. clean() メソッドを使う際に必要です。
  304. </entry>
  305. </row>
  306. </tbody>
  307. </tgroup>
  308. </table>
  309. </sect2>
  310. <sect2 id="zend.cache.backends.platform">
  311. <title>Zend_Cache_Backend_ZendPlatform</title>
  312. <para>
  313. このバックエンドは、<ulink url="http://www.zend.com/products/platform">Zend Platform</ulink>
  314. 製品のコンテンツキャッシング API を使用します。当然、このバックエンドを使用するには
  315. Zend Platform をインストールする必要があります。
  316. </para>
  317. <para>
  318. このバックエンドはタグをサポートしています。しかし、
  319. クリーニングモード <constant>CLEANING_MODE_NOT_MATCHING_TAG</constant> はサポートしていません。
  320. </para>
  321. <para>
  322. <classname>Zend_Cache::factory()</classname> メソッドでこのバックエンドを指定する場合は、
  323. 'Zend' と 'Platform' の間に区切り文字を入れます。区切り文字としては
  324. '-'、'.'、' ' あるいは '_' が使用できます。
  325. </para>
  326. <programlisting language="php"><![CDATA[
  327. $cache = Zend_Cache::factory('Core', 'Zend Platform');
  328. ]]></programlisting>
  329. <para>
  330. このバックエンドではオプションを使用しません。
  331. </para>
  332. </sect2>
  333. <sect2 id="zend.cache.backends.twolevels">
  334. <title>Zend_Cache_Backend_TwoLevels</title>
  335. <para>
  336. この (拡張) バックエンドは複合型です。
  337. キャッシュレコードを、
  338. 高速 (だが制限付き) な Apc、Memcache…… および "低速"
  339. な File、Sqlite…… の 2 種類の別々のバックエンドに格納します。
  340. </para>
  341. <para>
  342. このバックエンドは priority パラメータを使用 (フロントエンドレベルで、記録開始時に指定)
  343. し、高速バックエンドの残りのスペースを用いてふたつのバックエンドの使用を最適化します。
  344. FIXME
  345. </para>
  346. <para>
  347. 使用可能なオプションは次のとおりです。
  348. </para>
  349. <table id="zend.cache.backends.twolevels.table">
  350. <title>TwoLevels バックエンドのオプション</title>
  351. <tgroup cols="4">
  352. <thead>
  353. <row>
  354. <entry>オプション</entry>
  355. <entry>データ型</entry>
  356. <entry>デフォルト値</entry>
  357. <entry>説明</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. "低速" バックエンドの名前。
  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. "高速" バックエンドの名前。
  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. "低速" バックエンドのオプション。
  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. "高速" バックエンドのオプション。
  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. true の場合は、引数 slow_backend を完全なクラス名として使用します。
  399. false の場合は、引数をクラス名 "Zend_Cache_Backend_[...]"
  400. の最後の部分として使用します。
  401. </entry>
  402. </row>
  403. <row>
  404. <entry><emphasis>fast_backend_custom_naming</emphasis></entry>
  405. <entry><type>Boolean</type></entry>
  406. <entry><constant>FALSE</constant></entry>
  407. <entry>
  408. true の場合は、引数 fast_backend を完全なクラス名として使用します。
  409. false の場合は、引数をクラス名 "Zend_Cache_Backend_[...]"
  410. の最後の部分として使用します。
  411. </entry>
  412. </row>
  413. <row>
  414. <entry><emphasis>slow_backend_autoload</emphasis></entry>
  415. <entry><type>Boolean</type></entry>
  416. <entry><constant>FALSE</constant></entry>
  417. <entry>
  418. true の場合は、低速バックエンドに対して require_once を行いません
  419. (独自のバックエンドを使用する場合にのみ有用です)。
  420. </entry>
  421. </row>
  422. <row>
  423. <entry><emphasis>fast_backend_autoload</emphasis></entry>
  424. <entry><type>Boolean</type></entry>
  425. <entry><constant>FALSE</constant></entry>
  426. <entry>
  427. true の場合は、高速バックエンドに対して require_once を行いません
  428. (独自のバックエンドを使用する場合にのみ有用です)。
  429. </entry>
  430. </row>
  431. <row>
  432. <entry><emphasis>auto_refresh_fast_cache</emphasis></entry>
  433. <entry><type>Boolean</type></entry>
  434. <entry><constant>TRUE</constant></entry>
  435. <entry>
  436. true の場合は、キャッシュレコードにヒットしたときに
  437. 高速キャッシュを自動的にリフレッシュします。
  438. </entry>
  439. </row>
  440. <row>
  441. <entry><emphasis>stats_update_factor</emphasis></entry>
  442. <entry><type>Integer</type></entry>
  443. <entry>10</entry>
  444. <entry>
  445. 高速バックエンドを使用率の計算を無効化 / 効率化します
  446. (レコードをキャッシュに書き込む際の
  447. 高速バックエンド使用率の計算は、
  448. キャッシュ書き込み x 回につき 1 回の割合でランダムに行われます)。
  449. </entry>
  450. </row>
  451. </tbody>
  452. </tgroup>
  453. </table>
  454. </sect2>
  455. <sect2 id="zend.cache.backends.zendserver">
  456. <title>Zend_Cache_Backend_ZendServer_Disk および Zend_Cache_Backend_ZendServer_ShMem</title>
  457. <para>
  458. これらのバックエンドは、キャッシュレコードの保存に
  459. <ulink url="http://www.zend.com/en/products/server/downloads-all?zfs=zf_download">Zend Server</ulink>
  460. のキャッシュ機能を使用します。
  461. </para>
  462. <para>
  463. 注意: このバックエンドでは、今のところ "タグ" がサポートされていません。
  464. また、引数 "doNotTestCacheValidity=true" もサポートされていません。
  465. </para>
  466. <para>
  467. これらのバックエンドが動作するのは、Zend Server 環境で
  468. HTTP(S) 越しにページをリクエストした場合のみです。
  469. コマンドラインでスクリプトを実行した場合は動作しません。
  470. </para>
  471. <para>
  472. このバックエンドにはオプションはありません。
  473. </para>
  474. </sect2>
  475. </sect1>
  476. <!--
  477. vim:se ts=4 sw=4 et:
  478. -->