public removeCacheControlDirective ( string $name ) : void | ||
$name | string | Name of the directive, for example "public" |
리턴 | void |
public function removeCacheControlDirective($name)
{
switch ($name) {
case 'public':
case 'private':
case 'no-cache':
$this->cacheDirectives['visibility'] = '';
break;
case 'no-store':
case 'max-age':
case 's-maxage':
case 'no-transform':
case 'must-revalidate':
case 'proxy-revalidate':
$this->cacheDirectives[$name] = '';
break;
}
}
/** * (RFC 2616 / 14.9.4) * * @test */ public function mustRevalidateAndProxyRevalidateAreRenderedCorrectly() { $headers = new Headers(); $headers->setCacheControlDirective('must-revalidate'); $this->assertEquals('must-revalidate', $headers->get('Cache-Control')); $headers->removeCacheControlDirective('must-revalidate'); $headers->setCacheControlDirective('proxy-revalidate'); $this->assertEquals('proxy-revalidate', $headers->get('Cache-Control')); }