让我们说我有简单的行动
/**
* @Route("/{record}", name="record_view")
* @ParamConverter("record", class="AcmeDemoBundle:Record", options={"id" : "record"})
* @param Request $request
* @param Record $record
* @return Response
*/
public function recordViewAction(Request $request, Record $record)
{
return new Response($record->getContent());
}
以及我更新记录内容(不是表格)的其他行动
/**
* @Route("/edit/{record}", name="record_edit")
* @ParamConverter("record", class="AcmeDemoBundle:Record", options={"id" : "record"})
* @param Request $request
* @param Record $record
* @return Response
*/
public function recordEditAction(Request $request, Record $record)
{
$orm = $this->getDoctrine()->getManager();
$record->setContent('lorem ipsum');
$orm->persist($record);
$orm->flush();
}
问题是当调用编辑功能时,视图操作有旧内容..我使用APCu所以我的配置如下所示:
doctrine:
orm:
metadata_cache_driver: apcu
result_cache_driver: apcu
query_cache_driver: apcu
我知道我可以删除特定/所有缓存,但在特定缓存上,基于paramConverter注释,我没有结果缓存ID?是否有任何解决方案可以删除特定结果?也许在同花顺听众中?