Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
35 views
ago in Q2A Core by

To boost full speed I need to use rel="preload" for stylesheet 

I want to use this 

<link rel="preload" href="stylesheet.css" as="style" onload="this.rel='stylesheet'">
ago by
Will doing this help improve my site?

1 Answer

+1 vote
ago by

Is this for the main Q2A stylesheet, or for some custom styles? I don't think adding preload makes any difference for the main stylesheet - you want to load it as soon as you get to it, not asynchronously.

But it can be done in your theme. Probably the best function to override would be head_title() as that comes near the beginning of <head>

public function head_title()
{
    $this->output('<link rel="preload" href="stylesheet.css" as="style" onload="this.rel=\'stylesheet\'">');
    parent::head_title();
}

ago by
Thanks.........
...