Description

When using Zend_Cache_Frontend_Class to proxy an object, I can create two different objects of different classes with different caching proxy objects.

Unfortunately, as long as the function name is the same, they share results! The cache ID is based only on the function name and arguments.

I found this to be completely counterintuitive and not obvious from the documentation.

Proposal: When constructing the ID key to cache with, additionally use the classname of the object (determined by reflection on init) or string classname for static calls. This way, a cached result is not improperly shared across all objects and all classes that have the same method name and inputs.

Patch to implement/fix is attached.

Comments

Posted by Darien Hager (hagerd) on 2008-01-24T20:49:19.000+0000

This patch should address the biggest problem--sharing across classes.

However, it still does not differentiate between caches for two objects of the same class with the same function and parameters.