Add method to add http2 server push headers

This commit is contained in:
Timothy Warren 2017-04-12 12:52:49 -04:00
parent 9105b40b5e
commit a00ec4473c

View File

@ -98,6 +98,19 @@ abstract class View
return $this; return $this;
} }
/**
* Add an http2 server push header
*
* @param string $path - The host-relative path to the asset
* @param string $type - The type of asset
* @return ViewInterface
*/
public function addPushHeader(string $path, string $type): ViewInterface
{
$this->addHeader('Link', "<{$path}>; rel=preload; as={$type}");
return $this;
}
/** /**
* Set the output string * Set the output string
* *