Version: 4.3
Result cache
MikroORM has simple result caching mechanism. It works with those methods of
EntityManager
: find()
, findOne()
, findAndCount()
, findOneOrFail()
,
count()
, as well as with QueryBuilder
result methods (including execute
).
By default, in memory cache is used, that is shared for the whole MikroORM
instance. Default expiration is 1 second.
Or with query builder:
We can change the default expiration as well as provide custom cache adapter in the ORM configuration:
Custom cache adapters need to implement CacheAdapter
interface.