๐—ช๐—ต๐—ฒ๐—ป ๐˜๐—ผ ๐—•๐—น๐—ผ๐—ฐ๐—ธ ๐—ฅ๐—ฒ๐—ป๐—ฑ๐—ฒ๐—ฟ๐—ถ๐—ป๐—ด ๐—ช๐—ถ๐˜๐—ต ๐—ฆ๐—ฐ๐—ฟ๐—ถ๐—ฝ๐˜๐˜€

Web developers love non-blocking scripts. You use async or defer to speed up your page. This is a good habit. But some cases require blocking rendering.

Blocking means the browser stops painting. It waits for the script to finish. This slows down the first view. But it prevents bigger problems.

Use blocking scripts for these needs:

Blocking delays First Contentful Paint. This is a high price. Only pay this price if functional integrity is more important than speed.

Follow this simple rule:

Do not follow rules blindly. Use the right tool for your specific goal.

Source: https://dev.to/pavkode/blocking-rendering-with-scripts-when-and-why-to-avoid-asyncdefer-in-the-pp