Open avtop3 opened 8 years ago
Thanks, I'll take a look at it when I have time
Feel free suggesting your solution to this. Pull request is welcome
Since this is actually a css, it has been included as css, etc, there is actually only one way to implement this:
registerCssFile
with additional special opti$ons
to indicate that this asset should be treated like a fontSomething like this instead of preg_match_all
(much slower, but working)
$dom = new DomDocument();
foreach ($view->cssFiles as $linkTag) {
$dom->loadHTML($linkTag);
$link = $dom->getElementsByTagName("link")->item(0);
$href = $link->attributes->getNamedItem("href");
$href = $href === null ? "" : $href->value;
$type = $link->attributes->getNamedItem("push-type");
if ($type !== null) {
$type = $type->value;
} else {
$type = "style";
}
$this->addPreloadHeader($href, $type);
}
As I understood from Internet, only relative URIs could be server pushed Also font type resources don't processed as assume.