2.4. Zend_Cache backends

2.4.1. Zend_Cache_Backend_File

This backends stores cache records into files (in a choosen directory).

Available options are :

Tabela 2.6. Available options

Option Data Type Default Value Description
cacheDir string '/tmp/' Directory where to store cache files
fileLocking boolean true Enable / disable fileLocking : Can avoid cache corruption under bad circumstances but it doesn't help on multithread webservers or on NFS filesystems...
readControl boolean true Enable / disable read control : if enabled, a control key is embeded in the cache file and this key is compared with the one calculated after the reading.
readControlType string 'crc32' Type of read control (only if read control is enabled). Available values are : 'md5' (best but slowest), 'crc32' (lightly less safe but faster, better choice), 'strlen' for a length only test (fastest).
hashedDirectoryLevel int 0 Hashed directory structure level : 0 means "no hashed directory structure", 1 means "one level of directory", 2 means "two levels"... This option can speed up the cache only when you have many thousands of cache files. Only specific benchs can help you to choose the perfect value for you. Maybe, 1 or 2 is a good start.
hashedDirectoryUmask int 0700 Umask for the hashed directory structure

2.4.2. Zend_Cache_Backend_Sqlite

This backends stores cache records into a SQLite database.

Available options are :

Tabela 2.7. Available options

Option Data Type Default Value Description
cacheDBCompletePath (mandatory) string null The complete path (filename included) of the SQLite database

2.4.3. Zend_Cache_Backend_Memcached

This backends stores cache records into a memcached server. memcached is a high-performance, distributed memory object caching system. To use this backend, you need a memcached daemon and the memcache PECL extension.

Be careful : with this backend, "tags" are not supported for the moment as the "doNotTestCacheValidity=true" argument.

Available options are :

Tabela 2.8. Available options

Option Data Type Default Value Description
servers array array(array('host' => 'localhost','port' => 11211, 'persistent' => true)) An array of memcached servers ; each memcached server is described by an associative array : 'host' => (string) : the name of the memcached server, 'port' => (int) : the port of the memcached server, 'persistent' => (bool) : use or not persistent connections to this memcached server
compression boolean flase true if you want to use on-the-fly compression

2.4.4. Zend_Cache_Backend_APC

This backends stores cache records in shared memory through the APC (Alternative PHP Cache) extension (which is of course need for using this backend).

Be careful : with this backend, "tags" are not supported for the moment as the "doNotTestCacheValidity=true" argument.

There is no option for this backend.