Render blocking resources
JavaScript
Scripts can block rendering. To remediate this issue:
- inline critical JS resources in
<script>
tag - defer non critical resources with
async
ordefer
attributes (see adding interactivity with JS) - remove unused code
CSS
CSS can also be blocking. To mitigate this:
- split CSS using critical tool
- inline critical (above the fold) CSS in
<style>
tag - use
media
attribute to load only on targeted devices (see render blocking CSS) - use
preload
to load non critical CSS asynchronously - minify CSS
Resources
More information can be found reading this article.