The Zend Data Cache API is a set of functions for caching data items
or output.
The Zend Data Cache is used for the partial caching of content to your
shared memory or disk.
Function: boolean zend_shm_cache_store(string
namespace::key, mixed value, int ttl=0)
Stores a variable identified by key into the cache. If a namespace is provided,
the key is stored under that namespace. Identical keys can exist under
different namespaces
Parameters:
string namespace::key - The data's key. Optional: prefix with a namespace
mixed value - Any PHP object that can be serialized
int ttl - - Time to live, in seconds. The Data Cache keeps an object in
the cache as long as the TTL is not expired. Once the TTL is expired,
the object is removed from the cache
Returns: FALSE if cache storing fails, TRUE otherwise
Available since: 4.0
Function: boolean zend_disk_cache_store(string namespace::key,
mixed value, int ttl=0)
Stores a variable identified by a key into the cache. If a namespace is
provided, the key is stored under that namespace. Identical keys can exist
under different namespaces
Parameters:
string namespace::key - The data key. Optional: prefix with a namespace
mixed value - Any PHP object that can be serialized.
int ttl - - Time to live, in seconds. The Data Cache keeps objects in the
cache as long as the TTL is not expired. Once the TTL is expired, the
object is removed from the cache
Returns: FALSE if cache storing fails, TRUE otherwise
Available since: 4.0
Function: mixed zend_shm_cache_fetch(mixed namespace::key)
Fetches data from the cache. The key can be prefixed with a namespace to
indicate searching within the specified namespace only. If a namespace
is not provided, the Data Cache searches for the key in the global namespace
Parameters:
mixed namespace::key - The data key or an array of data keys. Optional
for key's name: prefix with a namespace
Returns: FALSE if no data that matches the key is found, else it
returns the stored data, If an array of keys is given, then an array which
its keys are the original keys and the values are the corresponding stored
data values
Available since: 4.0
Function: mixed zend_disk_cache_fetch(mixed namespace::key)
Fetches data from the cache. The key can be prefixed with a namespace to
indicate searching within the specified namespace only. If a namespace
is not provided, the Data Cache searches for the key in the global namespace
Parameters:
mixed namespace::key - The data key or an array of data keys. Optional
for key's name: prefix with a namespace
Returns: FALSE if no data that matches the key is found, else it
returns the stored data, If an array of keys is given, then an array which
its keys are the original keys and the values are the corresponding stored
data values
Available since: 4.0
Function: boolean zend_shm_cache_delete(mixed namespace::key)
Finds and deletes an entry from the cache, using a key to identify it.
The key can be prefixed with a namespace to indicate that the key can
be deleted within that namespace only. If a namespace is not provided,
the Data Cache searches for the key in the global namespace
Parameters:
mixed namespace::key - The data key or an array of data keys. Optional
for key's name: prefix with a namespace
Returns: TRUE on success, FALSE on failure.
Available since: 4.0
Function: boolean zend_disk_cache_delete(string namespace::key)
Finds and deletes an entry from the cache, using a key to identify it.
The key can be prefixed with a namespace to indicate that the key can
be deleted within that namespace only. If a namespace is not provided,
the Data Cache searches for the key in the global namespace
Parameters:
string namespace::key - The data key or an array of data keys. Optional
for key's name: prefix with a namespace
Returns: TRUE on success, FALSE on failure.
Available since: 4.0
Function: boolean zend_shm_cache_clear(string namespace)
Deletes all entries from all namespaces in the cache, if a 'namespace'
is provided, only the entries in that namespace are deleted
Parameters:
string namespace - The data key. Optional: prefix with a namespace
Returns: If the namespace does not exist or there are no items to
clear, the function will return TRUE. The function will return FALSE only
in case of error.
Available since: 4.0
Function: boolean zend_disk_cache_clear(string namespace)
Deletes all entries from all namespaces in the cache, if a 'namespace'
is provided, only the entries in that namespace are deleted
Parameters:
string namespace - The data key. Optional: prefix with a namespace
Returns: If the namespace does not exist or there are no items to
clear, the function will return TRUE. The function will return FALSE only
in case of error.
Available since: 4.0
zend_datacache.shm.max_segment_size
The maximal size of a shared memory segment
Default value(s):
32: for: WindowsAll , for: linux-i386 , for: linux-x86_64 , for: linux-amd64
,
2: for: darwin , for: sunos , for: freebsd-i386 , for: freebsd-x86_64 ,
for: aix-ppc ,
Type: int
Measurement units: MBytes
Available since: 4.0
zend_datacache.shm.memory_cache_size
Amount of shared memory to be used by the cache
Default value(s):
32: for: WindowsAll , for: linux-i386 , for: linux-x86_64 , for: linux-amd64
,
2: for: darwin , for: sunos , for: freebsd-i386 , for: freebsd-x86_64 ,
for: aix-ppc ,
Type: int
Measurement units: MBytes
Available since: 4.0
zend_datacache.disk.save_path
The path for storing cached content to the disk
Default value(s):
datacache:
Type: string
Measurement units:
Available since: 4.0
zend_datacache.disk.dir_level
Directory depth, for storing keys
Default value(s):
2:
Type: int
Measurement units:
Available since: 4.0
zend_datacache.enable
Enables the Data Cache. The Data Cache cannot work without this directive.
The Data Cache can be turned on or off from the Administration Interface
Default value(s):
1:
Type: boolean
Measurement units:
Available since: 4.0
zend_datacache.apc_compatibility
When enabled, the Data Cache extension registers APC compatibility methods
Default value(s):
1:
Type: boolean
Measurement units:
Available since: 4.0