Jurian Sluiman wrote: > > My problem is *many* data is loaded. Besides acl, auth and i18n also > containers at the page with "latest blog posts", "last tweet", "recent > pictures" etc. Therefore I thought let's cache everything! :p > I think that the point Giorgio was trying to make was the old saying: "premature optimization is the root of all evil" or something along those lines.
I'm always wanting to "think ahead" of where/how to get more performance out of my applications but I sometimes forget just how fast certain things really take place. Some of the queries may only take milliseconds to complete so eliminating/caching them will not really provide that much benefit (and possibly take up unnecessary space in your cache), so the "cache everything" *could* end up harming performance rather than increase it. Bottom line is that caching can have a tremendous impact on your performance but you have to make sure you do it correctly (cache invalidation, enough space to avoid unnecessary misses, etc), but it isn't a silver bullet that will solve all of your problems either. XDebug is your friend, but at the same time if you aren't having performance issues now then don't spend too much time as you could be adding other features instead. All of that said, I'd be interested in hearing more about your idea for Doctrine caching. But to reiterate something from above, maybe not make ALL of your Doctrine entities inherit this class, only the ones that would benefit from it (ie. don't make it a dependency just an optional feature). -- View this message in context: http://n4.nabble.com/Good-practice-for-caching-objects-tp1745708p1746841.html Sent from the Zend Framework mailing list archive at Nabble.com.
