System Design · Middle · Question 31 of 75
Why are third-party scripts (analytics, chats, ads) dangerous for performance?
- ✓Correct answer: They compete for the main thread and network and can block rendering
- 2They don't affect performance since they load from other domains
- 3They speed up the site thanks to the provider's CDN cache
Explanation
Third-party code can be heavy and is outside your control. Load it asynchronously and deferred (next/script with the lazyOnload strategy), use facades (a preview instead of the widget), move it to workers (Partytown), set a budget.