Redisを使用して、自分のエンティティに第2レベルのREAD_WRITE
キャッシュを設定しました。Doctrine:第2レベルのキャッシュ
新しいエンティティを挿入するとキャッシュがクエリに対して無効にならない理由は、エンティティを更新または削除すると無効になります。例えば。この場合
$this
->getDoctrine()
->getManager()
->getRepository('AppBundle:Test')
->createQueryBuilder('s')
->select('s')
->getQuery()
->setCacheable(true)
->getResult(); // this is my query.
それはキャッシュを無効にします。
$a = $this
->getDoctrine()
->getManager()
->getRepository("AppBundle:Test")
->find(119);
$a->setName("new value");
$a->setType("new value");
しかし、この場合にはそれが間違って何
$a = new Test();
$a->setName('fg');
$a->setType('bbbb');
$this->getDoctrine()->getManager()->persist($a);
$this->getDoctrine()->getManager()->flush();
を無効にしたくないのですか?