title: Symfony HTTP Cache-Control header overriding
body: <p>I've answered <a href="https://stackoverflow.com/questions/50011465/symfony-http-cache-doesnt-work-in-3-4">this</a> question some time ago. </p>
  
  <p>My code at the moment in Symfony 3.4. </p>
  
  <pre><code> $response-&gt;setCache([
       'max_age' =&gt; 3600,
       'public' =&gt; true,
       's_maxage' =&gt; 3600,
   ]);
  
  
   // (optional) set a custom Cache-Control directive
   $response-&gt;headers-&gt;addCacheControlDirective('must-revalidate', true);
  
   return $response;
  </code></pre>
  
  <p>In some reason I'm still getting <code>Cache-Control</code> and other headers like this: </p>
  
  <pre><code>Cache-Control: max-age=0, must-revalidate, private, s-maxage=3600
  X-Symfony-Cache: GET /: miss
  </code></pre>
  
  <p>I've noticed that in Symfony 3.2 code works well, but  in 3.4 I'm not getting <code>public</code> in Cache-Control (and <code>max-age=0</code> looks bad too).</p>
  
  <p>Second thing is dumping <code>$response</code> in controller - everything looks fine:</p>
  
  <pre><code>#headers: array:2 [▼
    "cache-control" =&gt; array:1 [▼
      0 =&gt; "max-age=3600, must-revalidate, public, s-maxage=3600"
    ]
    "date" =&gt; array:1 [▼
      0 =&gt; "Sat, 12 May 2018 18:42:04 GMT"
    ]
  ]
  </code></pre>
  
  <p>Is it somekind of Symfony bug? Should I report it?</p>