Performance: Including sub-views (@include)
MEDIUM IMPACT
This affects the server-side rendering time and the size of the HTML sent to the browser, impacting the initial page load speed.
@includeWhen($showHeader, 'header') @includeWhen($showSidebar, 'sidebar') @include('content') @include('footer')
@include('header') @include('sidebar') @include('content') @include('footer') @include('comments') @include('related-posts')
| Pattern | Server Render Time | HTML Size | LCP Impact | Verdict |
|---|---|---|---|---|
| Many unconditional @include calls | High (multiple file reads) | Large (more HTML) | Slower LCP | [X] Bad |
| Conditional @include calls | Medium (fewer files) | Smaller (less HTML) | Faster LCP | [OK] Good |