Are API fetches (especially all the ones wrapped around persistent layer) cached and reused somehow within a single request? When carrying out some PHP tasks that require fetching data, I always wonder if I should implement my own caching mechanisms.
<b>Example:</b> Let's say, we have an array of 100 objects with user ID references (7 different users). I want to fetch user object for each of the 100 objects. I could simply walk the array and fetch user object each time, which would make 100 times, but in fact, only 7 user fetches are actually necessary. Now, does eZ take care of such recurring fetches? Should I implement my own cache (which is quite easy) or would that be unnecessary work?
Objects, classes, sections, class attributes and I also think user object is cached. They are cached with global variables in the different sections of the kernel.
The core team did test out putting the cache code in persistant object during 3.9 development, but it had too many regressions.