You can clone with
I discovered a problem with CDbCacheDependency and reuseDependentData.
Check the following scenario:
Both foo() and bar() call getCache/setCache(), using different keys, but using the same dependency.
$dependency = new CDbCacheDependency("SELECT MAX(updatedOn) FROM Table");
$dependency->reuseDependentData = true; // execute dependency once per request
Solution: the dependency result still has to be compared to the cached dependency result. We simply remove the hasChanged boolean with the cached value and compare the data every time: http://pastebin.com/yD77KqK8
Is the example clear enough?
@marcovtwout, could you compose a Pull Request for this issue?
If you ready to do so, please read the contribution workflow first.
Resolved by commit 0adc8