I am running into a problem (on different hostings) and I cannot really change host settings so I am looking for PHP solution.
When I am sending response to browser (Symfony's HttpFoundation\Response) some headers are duplicate and they contradict themselves. Than browser will not cache them.
PHP code
$response = new Response(
$html,
200,
array(
"content-type" => "text/html; charset=UTF-8",
)
);
$response->setCache(array(
'last_modified' => $page->getEditedAt(),
'max_age' => $staticCache,
's_maxage' => $staticCache,
'private' => false,
'public' => true,
));
Some of headers in browser
Cache-Control:max-age=1800, public, s-maxage=1800
Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Date:Tue, 01 Oct 2013 15:08:39 GMT
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Pragma:no-cache
But my page should be public and cacheable. Where are the rest of headers set and how can i turn them off?