Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
496 views
in Q2A Core by
reshown 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'">
by
Will doing this help improve my site?

1 Answer

+1 vote
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();
}

by
Thanks.........
by
@Scott Brother I use custom fonts in my theme but it loads after 10 seconds. For this I want to use my font as preload. It would be nice if you could tell me the rules for using it
...