Download Zend Server Reference Manual

Transcript
Zend Server Reference Manual
'namespace' Support
Using namespaces for caching provides the ability to define a key that can serve as an identifier
to delete select items from the cache, rather than unnecessarily removing shared instances.
'namespace' support is intended for environments that run large applications that are separated
into modules. Applying a 'namespace' to each module provides the identification necessary to
pinpoint all the cached items that belong to a given module and remove only those specific items.
This does not mean that you must use the 'namespaces' to clear the cache: The entire cache can
be cleared by using the 'output_cache_remove' function.
Setting the cached 'namespace':
The cache 'namespace' is set by adding it as a prefix to the cache with '::' as the separator.
Example:
This example shows how to manipulate variable caching using a 'namespace'
zend_disk_cache_store("my_namespace::my_key",$data) is fetched with
zend_disk_cache_fetch("my_namespace::my_key");
zend_shm_cache_clear("my_namespace") clears all the keys that start with
"my_namespace::"
Cache Folder Depth Configuration
Defining the Cache folder depth is intended for environments that use a large number of keys. By
definition, cached content is separated into different directories by key, to prevent performance
degradation caused by accessing files that contain large amounts of content. This option is only
available with disk caching. Increase the cache folder depth according to the quantity of content
that requires caching (small amount = 0, large quantities = 2).
Note:
A single directory may include several keys, depending on the quantity of cached content.
The cache folder depth is defined by the directive zend_cache.disk.dir_levels. The value of the
directive configures how the cached files are stored. The accepted values for this directive are 0,
1 or 2, where:
0 = one directory containing all the cache files
1 = a separate directory under the cache directory
2 = an additional sub directory for cached content under the cache directory
133