title: Symfony2 Reverse proxy has a cache control private
body: <p>I'm playing with Symfony2 Reverse proxy and HTTP cache and I had a lot of read on the subject.
  However I'm getting stuck on how it works in my case.</p>
  
  <p>Here is a use case.</p>
  
  <p><code>GET /api/articles</code> returns something like:</p>
  
  <pre><code>HTTP/1.1 200 OK
  Content-Encoding: gzip
  Content-Type: application/json
  Set-Cookie: PHPSESSID=12345; expires=Thu, 14-Nov-2013 14:50:35 GMT; path=/
  age: 0
  allow: GET, POST
  cache-control: must-revalidate, no-cache, private
  etag: "da4b6c4f1540a12a112936e58db06df8c95fd3c4"
  vary: Accept,Accept-Encoding
  x-content-digest: enbf30f962b06f99bd91843741537e112fbd3300c8
  x-symfony-cache: GET /api/articles: miss, store
  </code></pre>
  
  <p>As you can see there the <code>Cache-Control</code> header is marked as private along with no-cache &amp; must-revalidate. <strong>However</strong>, I think I'm setting the <code>Response</code> correctly:</p>
  
  <pre><code>    $response = clone $view-&gt;getResponse();
      $response
          -&gt;setPublic()
          -&gt;setEtag($etag)
          -&gt;setSharedMaxAge(60)
          -&gt;setVary(array('Accept'))
      ;
      if ($response-&gt;isNotModified($this-&gt;getRequest())) {
  
          return $response;
      }
  </code></pre>
  
  <p>I set it to Public so it should work. You may have noticed the <code>Set-Cookie</code> header, I dunno if it matters, but as long as I set the cache as public it shouldn't, isn't it?</p>
  
  <p>Now, if I <code>GET /api/articles</code> with an <code>If-None-Match: {etag}</code> I get a 304 which is correct, but the <code>Cache-Control</code> header is the same.</p>
  
  <p>Note that if I disable the Reverse Proxy, the Cache-Control is correct and showing me:</p>
  
  <p><code>Cache-Control: public, s-maxage=60</code> which is what I except.</p>