[英]TYPO3 Extbase Repository Query Cache
I have some questions about caching. 我有一些关于缓存的问题。 Some preconditions first:
一些先决条件首先:
// query 1
$data1 = $this->myRepository->findByPid($myPid);
// query 2
$data2 = $this->myRepository->findOneByUid($myUid);
My questions: 我的问题:
The behavior is different for older and newer Typo3 versions. 对于较旧和较新的Typo3版本,行为是不同的。 Afaik from Typo3 7.x onwards the cache is always used if you use the default repository queries.
从Typo3 7.x开始,如果您使用默认存储库查询,则始终使用缓存。 After retrieving a dataset from the database it is mapped to a domain object by the property mapper and if the object is already present in the cache it is returned instead.
从数据库中检索数据集后,属性映射器将其映射到域对象,如果该对象已存在于缓存中,则返回该对象。
In Typo3 6.x you would get two different objects for the same uid if you select it with ->findByUid
and for example as a controller argument 在Typo3 6.x中,如果使用
->findByUid
选择它,例如作为控制器参数,则会为同一个uid获取两个不同的对象
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.