No cache header with annotation
问题 In order to set the response without the cache in the controller you can do this: $response = new Response(); $result = $this->renderView( 'AcmeDemoBundle:Default:index.html.twig', array('products' => $products, 'form' => $form->createView())); $response->headers->addCacheControlDirective('no-cache', true); $response->headers->addCacheControlDirective('max-age', 0); $response->headers->addCacheControlDirective('must-revalidate', true); $response->headers->addCacheControlDirective('no-store',