diff --git a/src/View.php b/src/View.php index f8a4bbb..102b5ab 100644 --- a/src/View.php +++ b/src/View.php @@ -98,6 +98,19 @@ abstract class View 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 *