0
我试图使用symfony2清漆缓存。 设置为光油 - > NGNIX - > PHP-FPMSymfony2 Varnish NGINX缓存/ DebugToolbar
我的代码:
public function indexAction($city_url)
{
$response = new Response();
$response->setETag('foobar123fo');
if ($response->isNotModified($this->getRequest())) {
// return the 304 Response immediately
return $response;
}
$data = array('randA'=> rand());
$response = $this->render('Foo:Event:index.html.twig', $data);
$response->setCache(array(
'public' => true,
));
$response->setETag('foobar123fo');
$response->setSharedMaxAge(10);
return $response;
这按预期工作 - 我得到高速缓存命中,但Symfony的的调试工具栏被缓存为好。任何人都可以告诉我,如何排除工具栏被缓存?我想看看,在提供缓存结果时,确实没有例如SQL-Querys。
非常感谢!