You risk putting a lot of data in your cache. Also, depending on which type of cache you’re using, you may be deserialising a large amount of data on each request, which might well be slower and more processor intensive than just fetching the items from the database each time. Bear in mind that databases have facilities for optimising common queries.
Have you identified a bottleneck in your application?
Even if there is a way to do it through the cache, the problem will remain. So you are right…
I had override the afterFind (category) to load extra data from related table (products id) using CActiveRecord I will replace my code with a sql command query (DAO) to improve the performance