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。
非常感謝!