G
G
Gorila Lopster2018-12-26 14:14:55
OctoberCMS
Gorila Lopster, 2018-12-26 14:14:55

How to connect asynchronously a file with October CMS styles?

PageSpeed ​​Insights asks "Remove render-blocking resources"
css/home.css 12 KB 180 ms
I read on the Internet that you need to include a css file asynchronously, using this method:

$(document).ready(function() {
    $("head").append("<link rel='stylesheet' type='text/css' href='/styles.css' />");
})

at the moment home.css is included in head.htm
5c2363f50d450202962414.jpeg
with this code
[viewBag]
snippetCode = "head-slot" == {% component 'bronxSEOWidget' %}

<link rel="stylesheet" href="{{ 'assets/css/home.css'|theme }}" type="text/css" media="only screen" />

How and where to connect it so that Google speed does not swear ??

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaliy Orlov, 2018-12-26
@orlov0562

before </body> (closing body tag)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question