Question presented to candidate: "Our Lighthouse report says 'Eliminate render-blocking resources' and points at our stylesheet and Google Fonts link. Explain the critical render path, and what the Angular build already does about styles and fonts."
What a strong answer should cover:
- Critical render path: HTML parsing, CSSOM, render tree, layout, paint; CSS and web fonts block first paint, deferred scripts do not.
- Angular production builds: critical CSS inlining (Beasties) of the rules the initial HTML uses, and async loading of the full stylesheet (
media="print"swap plus<noscript>). - Critical CSS only helps when the HTML has content: SSR or prerendering, not an empty CSR shell.
- Font inlining (
optimization.fonts.inline) for Google Fonts and Adobe Fonts CSS at build time. - Scripts as
type="module"withmodulepreload; component styles bundled in JS (and emitted in the head during SSR). - Related levers:
NgOptimizedImage prioritypreload,@defer, budgets inangular.json.
Clarifying questions expected:
- "Is the app server-rendered or prerendered? That decides whether critical CSS inlining can do anything."
- "Are fonts self-hosted or from Google Fonts?"
Code / implementation expected: Optional β the relevant angular.json options and a look at the built index.html.