Render blocking resources
JavaScript
Scripts can block rendering. To remediate this issue:
- inline critical JS resources in
<script>tag - defer non critical resources with
asyncordeferattributes (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
mediaattribute to load only on targeted devices (see render blocking CSS) - use
preloadto load non critical CSS asynchronously - minify CSS
Resources
More information can be found reading this article.
