public function addCacheControlHttpHeader($name, $value = null)
{
$cacheControl = $this->getHttpHeader('Cache-Control');
$currentHeaders = array();
if ($cacheControl) {
foreach (preg_split('/\\s*,\\s*/', $cacheControl) as $tmp) {
$tmp = explode('=', $tmp);
$currentHeaders[$tmp[0]] = isset($tmp[1]) ? $tmp[1] : null;
}
}
$currentHeaders[str_replace('_', '-', strtolower($name))] = $value;
$headers = array();
foreach ($currentHeaders as $key => $value) {
$headers[] = $key . (null !== $value ? '=' . $value : '');
}
$this->setHttpHeader('Cache-Control', implode(', ', $headers));
}