This questions is related to Kohana ORM AND Caching module. I use version 3.2 if it matters. I tried to research trust me, but I really couldn't find some good answer... so here it is:
What are the correct ways to use
ORM::cached()
andORM::serialize()
andORM::$reload_on_wakeup
?
I've seen many 2-line code examples but never anything really solid on the userguide/api...What is the difference between enabling Cache module and
'caching' => true
inKohana::init
?Anyone has any recommended approach for the following specific situations? I have a catalogue page that upon profiling, I realized two very expensive actions:
- I queried database each time for a currency model for each item, when the currency information can really be reused.
- I queried database each time for each item's inventory item, this is an expensive query, which I wish I can cache until inventory level changes.
References that I found but couldn't answer fully my questions:
http://forum.kohanaframework.org/discussion/1782/tip-for-caching-orm-objects/p1
http://forum.kohanaframework.org/discussion/10600/does-kohana-orm-and-cache-work-together/p1