Cdbcachedependency Multiple Sql Result

Hi

I want to caching user order, so the cache depended by items order counts.

so I could use CDbCacheDependency with query (count item A, count item B, count item C etc)

But the result depended by many rows

The sum((count item A, count item B, count item C etc)) is not reliable

For example A=5,B=3,C=5 (quantities) = sum 13

Suppose quantities become

A=6,B=3,C=8 = 17

then CDbCacheDependency assign the cache to be change, its ok!

But if quantities become

A=1,B=7, C = 5 = sum 13

this not changes the cache because we have the same result.

So, how to achieve that ?

BS: I could make it using select(concat(count item A, ‘.’, count item B, ‘.’ , count item C)) to result 5.3.5 and 1.7.5 that is most reliable but I don’t know if it is the right way…

Hi KonApaz,

Probably you have to be more specific about your query … What is the sql for the query? What tables do you use? What relations do they have? What data can be changed between the subsequent queries?

The answers will guide you to a proper dependency configuration.

BTW, you have to be VERY MUCH careful. I might not want to use query caching for the things that deal with money. ;)

Softark, Thank you for seggesting :)