[英]Symfony2 Varnish NGINX cache / DebugToolbar
我正在嘗試使用symfony2的清漆緩存。 設置為Varnish-> NGNIX-> php-fpm
我的代碼:
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查詢。
非常感謝!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.