Issues

ZF-2178: Zend_Cache utilization within other Zend Framework components

Description

Define an infrastucture and/or coding standard for utilizing Zend_Cache within other ZF components. The best backend available should be automatically chosen to make optimal Zend_Cache utilization relatively transparent. On the other hand, the backend should be configurable for each instance of use.

Comments

This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.

Stas, I believe you were looking in to this. Do you have a proposal? Is it something we'd want to do in one of the upcoming minor releases?

set component

Quickly thinking check if registry has "Zend_Cache" or "Zend_Cache_Transparent" and use that, and have methods for replacing the engine if needed to, ie. $object->setCacheEngine(obj Zend_Cache)

Easy and transparent.

Keys: a prefix, object name, method name, method call variables, potentially aswell (some) object variables. and have a method to change the prefix.

registry "Zend_Cache_Transparent" could be used to give more feasible option to set a separate engine for the transparent caching portions.

Most of the work ofc is in the other ZF components to actually implement this.

I found it as unassigned.

With the current Zend_Cache implementation there are some issues for using it on other components:

  1. The only interface to use is an instance of Zend_Cache_Core (frontend) there is no way to set/add cache functionality without changing options of this instance -> e.g. serializing have to be done by component. If its enabled on cache it will be double serialized

  2. The components can't use the best cache frontend because it gets already a frontend. -> e.g. data of Zend_Locale/Zend_Config are based on source files and should use Zend_Cache_Frontend_File to remove cache if source file changed but can't use because they have to accept a cache instance of Zend_Cache_Core

  3. The components can't accept backends to set they're own frontend because the backend alone isn't simple to get and on set they're own frontend some options are set to backend, too. Additionally some important options like "caching" are not configurable out of the component. -> e.g. $frontend->setLifetime() sets the lifetime directive on backend, too