title: Symfony2: use http cache
body: <p>Within Symfony2, I try to use http caching for few ajax calls that return always the same content in a day.</p>
  
  <p>My controller's code finishes with:</p>
  
  <pre><code>    $response = new JsonResponse($data);
      $response-&gt;setPublic();
      $response-&gt;setExpires(new \DateTime("+1 hour"));
      $response-&gt;setMaxAge(3600);
      return $response;
  </code></pre>
  
  <p>In the response (from Firefox or IE11) I can find the expected headers. But it always return a 200 code (OK) instead of 304 (not modified). This mean that the server always generate the response, whereas my goal is to underload my server.</p>
  
  <p>I also tried to use the @Cache annotation with the same result.</p>
  
  <p>How to make it work?</p>