Langsung ke konten utama

Cara Defer Async Kode CSS Blogger

Kali ini saya bagikan cara menggunakan defer atau async kode css di blogger. Karena selain dari widget css bundle yang memblokir perenderan konten paruh atas di blog. Ada kode css lain yang biasa dipanggil untuk mempercantik tampilan blog seperti dari maxcdn dan font awesome. Biasanya kode css eksternal itu ada karena menggunakan template luar selain dari template default bawaan blogger.

Dan sudah pasti kamu sering melihatnya. Pertanyaannya bagaimana kita menggunakan async atau defer kode css eksternal itu? Biasanya untuk font awesome bisa disematkan inline pada ]]></b:skin> blogger, namun apabila kode external css lainnya tidak dapat disematkan didalam Edit HTML blogger dan tetap ingin kamu defer, itu juga bagus karena akan lebih simpel dan menghemat ukuran HTML blog.

Baca juga:
~ Cara menghilangkan javascript yang memblokir rendering di konten paruh atas
~ Cara menghilangkan css yang memblokir blogger

Tujuan Defer Kode CSS

Tujuannya jelas karena ingin mempercepat loading blog agar rendering kode eksternal ditunda dulu sehingga konten utama blog dapat ditampilkan untuk pengunjung. Karena loading yang lama dapat membuat pengunjung pergi dari blog.

Cara Defer Kode CSS

Langkah 1. Copy kode script defer dibawah ini dan gantikan url link kode css yang ingin di defer.
<script type='text/javascript'>
//<![CDATA[
function loadCSS(e, t, n) { "use strict"; var i = window.document.createElement("link"); var o = t || window.document.getElementsByTagName("script")[0]; i.rel = "stylesheet"; i.href = e; i.media = "only x"; o.parentNode.insertBefore(i, o); setTimeout(function () { i.media = n || "all" }) }
loadCSS("https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css");
//]]>
</script>
Langkah 2. Letakkan kode yang telah di copy, diatas </head> blog kamu dan Simpan.

Sangat mudah bukan? Silahkan kamu cek dengan pagespeed insight milik google apakah kode css eksternal masih memblokir render konten paruh atasnya.

Komentar

Postingan populer dari blog ini

Juggernaut - Relic Blade of the Kuur-Ishiminari

This is mod sword of Juggernaut - Relic Blade of the Kuur-Ishiminari Dota 2 Reborn common weapon. This item originally from Lost Treasure of the Ivory Isles (Series 3). Green beautiful ambient effect will shown when idle and especially if Yurnero using his 1st skill "blade fury". Mod type: Standart . Hope you guys like this mod and support our favorite game in steam community market. The essence of gaming is fun. No money? Just mods. Enjoy the game and boost your MMR! For installation mod guide: How to install mods with vpk creator . Juggernaut - Relic Blade of the Kuur-Ishiminari

Terrorblade - Foulfell Corruptor

Terrorblade - Foulfell Corruptor mod mythical item Dota 2 Reborn from Treasure of the Emerald Revival with ultra rare chance to get it. This set has ambient effect on the weapon, Blades of the Foulfell Corruptor. This set items consists of: Armor of the Foulfell Corruptor, Demon Form of the, Foulfell Corruptor, Blades of the Foulfell Corruptor, Wings of the Foulfell Corruptora and Helm of the Foulfell Corruptor. It can be combine with  Terrorblade - Fractal Horns of Inner Abysm arcana mod. Hope you guys like this mod and support our favorite game in steam community market. No money? Just mods.The essential gaming is fun. Enjoy the game and boost your mmr!

Axe - Snowpack Savage

Mod skin Axe - Snowpack Savage rare item Dota 2 Reborn from Fortivus 2017 Treasure. This item consists of : Axe of the Snowpack Savage, Beard of the Snowpack Savage, Armor of the Snowpack Savage, Belt of the Snowpack Savage and Prize of the Snowpack Savage . Mod type: Standart . Hope you guys like this mod and support our favorite game in steam community market. The essence of gaming is fun. No money? Just mods. Enjoy the game and boost your MMR! For installation mod guide: How to install mods with vpk creator . Axe - Snowpack Savage