cache.memcached.php 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <?php
  2. return [
  3. /*
  4. 'memcached' => [
  5. 'driver' => 'memcached',
  6. 'servers' => [
  7. //[
  8. // 'host' => 'localhost',
  9. // 'port' => 11211,
  10. // 'weight' => 1,
  11. // ],
  12. ],
  13. 'options' => [
  14. // see http://php.net/manual/en/memcached.setoption.php and http://www.php.net/manual/en/memcached.constants.php
  15. //Memcached::OPT_COMPRESSION => TRUE,
  16. // Enables or disables payload compression. When enabled, item values longer than a certain threshold (currently 100 bytes) will be
  17. // compressed during storage and decompressed during retrieval transparently.
  18. // Type: boolean, default: TRUE.
  19. // more info https://github.com/iliaal/php-memcached/blob/master/memcached.ini
  20. //Memcached::OPT_SERIALIZER => Memcached::SERIALIZER_PHP,
  21. // Specifies the serializer to use for serializing non-scalar values. The valid serializers are Memcached::SERIALIZER_PHP or
  22. // Memcached::SERIALIZER_IGBINARY. The latter is supported only when memcached is configured with --enable-memcached-igbinary option and
  23. // the igbinary extension is loaded.
  24. // Type: integer, default: Memcached::SERIALIZER_PHP.
  25. //
  26. // Choices:
  27. // Memcached::SERIALIZER_PHP : The default PHP serializer.
  28. // Memcached::SERIALIZER_IGBINARY: The igbinary serializer. Instead of textual representation it stores PHP data structures in a
  29. // compact binary form, resulting in space and time gains.
  30. // Memcached::SERIALIZER_JSON : The JSON serializer. Requires PHP 5.2.10+.
  31. //Memcached::OPT_PREFIX_KEY => '',
  32. // This can be used to create a "domain" for your item keys. The value specified here will be prefixed to each of the keys. It cannot be
  33. // longer than 128 characters and will reduce the maximum available key size. The prefix is applied only to the item keys, not to the
  34. // server keys.
  35. // Type: string, default: "".
  36. //Memcached::OPT_HASH => Memcached::HASH_DEFAULT,
  37. // Specifies the hashing algorithm used for the item keys. The valid values are supplied via Memcached::HASH_* constants. Each hash
  38. // algorithm has its advantages and its disadvantages. Go with the default if you don't know or don't care.
  39. // Type: integer, default: Memcached::HASH_DEFAULT
  40. //
  41. // Choices:
  42. // Memcached::HASH_DEFAULT : The default (Jenkins one-at-a-time) item key hashing algorithm.
  43. // Memcached::HASH_MD5 : MD5 item key hashing algorithm.
  44. // Memcached::HASH_CRC : CRC item key hashing algorithm.
  45. // Memcached::HASH_FNV1_64 : FNV1_64 item key hashing algorithm.
  46. // Memcached::HASH_FNV1A_64: FNV1_64A item key hashing algorithm.
  47. // Memcached::HASH_FNV1_32 : FNV1_32 item key hashing algorithm.
  48. // Memcached::HASH_FNV1A_32: FNV1_32A item key hashing algorithm.
  49. // Memcached::HASH_HSIEH : Hsieh item key hashing algorithm.
  50. // Memcached::HASH_MURMUR : Murmur item key hashing algorithm.
  51. Memcached::OPT_DISTRIBUTION => Memcached::DISTRIBUTION_CONSISTENT,
  52. // Specifies the method of distributing item keys to the servers. Currently supported methods are modulo and consistent hashing.
  53. // Consistent hashing delivers better distribution and allows servers to be added to the cluster with minimal cache losses.
  54. // Type: integer, default: Memcached::DISTRIBUTION_MODULA.
  55. //
  56. // Choices:
  57. // Memcached::DISTRIBUTION_MODULA: Modulo-based key distribution algorithm.
  58. // Memcached::DISTRIBUTION_CONSISTENT: Consistent hashing key distribution algorithm (based on libketama).
  59. Memcached::OPT_LIBKETAMA_COMPATIBLE => TRUE,
  60. // Enables or disables compatibility with libketama-like behavior. When enabled, the item key hashing algorithm is set to MD5 and
  61. // distribution is set to be weighted consistent hashing distribution. This is useful because other libketama-based clients (Python,
  62. // Ruby, etc.) with the same server configuration will be able to access the keys transparently.
  63. // Note: It is highly recommended to enable this option if you want to use consistent hashing, and it may be enabled by default in future
  64. // releases.
  65. // Type: boolean, default: FALSE.
  66. //Memcached::OPT_BUFFER_WRITES => FALSE,
  67. // Enables or disables buffered I/O. Enabling buffered I/O causes storage commands to "buffer" instead of being sent. Any action that
  68. // retrieves data causes this buffer to be sent to the remote connection. Quitting the connection or closing down the connection will
  69. // also cause the buffered data to be pushed to the remote connection.
  70. // Type: boolean, default: FALSE.
  71. //Memcached::OPT_BINARY_PROTOCOL => FALSE,
  72. // Enable the use of the binary protocol. Please note that you cannot toggle this option on an open connection.
  73. // Type: boolean, default: FALSE.
  74. //Memcached::OPT_NO_BLOCK => FALSE,
  75. // Enables or disables asynchronous I/O. This is the fastest transport available for storage functions.
  76. // Type: boolean, default: FALSE.
  77. //Memcached::OPT_TCP_NODELAY => FALSE,
  78. // Enables or disables the no-delay feature for connecting sockets (may be faster in some environments).
  79. // Type: boolean, default: FALSE.
  80. //Memcached::OPT_SOCKET_SEND_SIZE => ,
  81. // The maximum socket send buffer in bytes.
  82. // Type: integer, default: varies by platform/kernel configuration.
  83. //Memcached::OPT_SOCKET_RECV_SIZE => ,
  84. // The maximum socket receive buffer in bytes.
  85. // Type: integer, default: varies by platform/kernel configuration.
  86. //Memcached::OPT_CONNECT_TIMEOUT => 1000,
  87. // In non-blocking mode this set the value of the timeout during socket connection, in milliseconds.
  88. // Type: integer, default: 1000.
  89. //Memcached::OPT_RETRY_TIMEOUT => 0,
  90. // The amount of time, in seconds, to wait until retrying a failed connection attempt.
  91. // Type: integer, default: 0.
  92. //Memcached::OPT_SEND_TIMEOUT => 0,
  93. // Socket sending timeout, in microseconds. In cases where you cannot use non-blocking I/O this will allow you to still have timeouts on the sending of data.
  94. // Type: integer, default: 0.
  95. //Memcached::OPT_RECV_TIMEOUT => 0,
  96. // Socket reading timeout, in microseconds. In cases where you cannot use non-blocking I/O this will allow you to still have timeouts on the reading of data.
  97. // Type: integer, default: 0.
  98. //Memcached::OPT_POLL_TIMEOUT => 1000,
  99. // Timeout for connection polling, in milliseconds.
  100. // Type: integer, default: 1000.
  101. //Memcached::OPT_CACHE_LOOKUPS => FALSE,
  102. // Enables or disables caching of DNS lookups.
  103. // Type: boolean, default: FALSE.
  104. //Memcached::OPT_SERVER_FAILURE_LIMIT => 0,
  105. // Specifies the failure limit for server connection attempts. The server will be removed after this many continuous connection failures.
  106. // Type: integer, default: 0.
  107. ],
  108. ],
  109. 'apc' => [
  110. 'driver' => 'apc',
  111. 'default_expire' => 3600,
  112. ],
  113. 'file' => [
  114. 'driver' => 'file',
  115. 'cache_dir' => APPPATH . 'cache',
  116. 'default_expire' => 3600,
  117. ]
  118. */
  119. ];