{"id":23455,"date":"2023-11-15T22:43:13","date_gmt":"2023-11-15T21:43:13","guid":{"rendered":"https:\/\/www.angulararchitects.io\/blog\/how-to-improve-initial-load-performance-with-angular-17s-deferrable-views\/"},"modified":"2025-03-24T20:47:02","modified_gmt":"2025-03-24T19:47:02","slug":"deferrable-views","status":"publish","type":"post","link":"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/","title":{"rendered":"Improve Initial Load Time with Deferrable Views"},"content":{"rendered":"<div class=\"wp-post-series-box series-performance-pptimization wp-post-series-box--expandable\">\n\t\t\t<input id=\"collapsible-series-performance-pptimization69d1d3c93afaa\" class=\"wp-post-series-box__toggle_checkbox\" type=\"checkbox\">\n\t\n\t<label\n\t\tclass=\"wp-post-series-box__label\"\n\t\t\t\t\tfor=\"collapsible-series-performance-pptimization69d1d3c93afaa\"\n\t\t\ttabindex=\"0\"\n\t\t\t\t>\n\t\t<p class=\"wp-post-series-box__name wp-post-series-name\">\n\t\t\tThis is post 4 of 6 in the series <em>&ldquo;Performance Optimization&rdquo;<\/em>\t\t<\/p>\n\t\t\t<\/label>\n\n\t\t\t<div class=\"wp-post-series-box__posts\">\n\t\t\t<ol>\n\t\t\t\t\t\t\t\t\t<li><a href=\"https:\/\/www.angulararchitects.io\/en\/blog\/why-is-initial-load-performance-so-important\/\">Why is Initial Load Performance so Important?<\/a><\/li>\n\t\t\t\t\t\t\t\t\t<li><a href=\"https:\/\/www.angulararchitects.io\/en\/blog\/how-to-measure-initial-load-performance\/\">How to measure Initial Load Performance<\/a><\/li>\n\t\t\t\t\t\t\t\t\t<li><a href=\"https:\/\/www.angulararchitects.io\/en\/blog\/how-to-use-angular-ssr-with-hydration\/\">How to use Angular SSR with Hydration<\/a><\/li>\n\t\t\t\t\t\t\t\t\t<li><span class=\"wp-post-series-box__current\">Improve Initial Load Time with Deferrable Views<\/span><\/li>\n\t\t\t\t\t\t\t\t\t<li><a href=\"https:\/\/www.angulararchitects.io\/en\/blog\/defer-large-deps\/\">How to @defer 3rd party dependencies<\/a><\/li>\n\t\t\t\t\t\t\t\t\t<li><a href=\"https:\/\/www.angulararchitects.io\/en\/blog\/guide-for-ssr\/\">Updated: Guide for Server-Side Rendering (SSR) in Angular<\/a><\/li>\n\t\t\t\t\t\t\t<\/ol>\n\t\t<\/div>\n\t<\/div>\n<p>Besides some minor updates concerning Server Side Rendering (including things as making the great new Hydration feature stable, renaming the universal package to <code>@angular\/ssr<\/code> and adding SSR support to the CLI's <code>ng new<\/code> command) the biggest upgrade for us <strong>performance enthusiasts<\/strong> in <em>Angular 17<\/em> is definitely the <strong>new block template syntax<\/strong> including the <strong>defer block<\/strong> feature. By the way, the new template syntax is also beneficial for the runtime performance - we'll cover that topic in another blog post soon \ud83d\ude0f<\/p>\n<p>Until <em>Angular 16<\/em> it was a bit complicated to dynamically lazy load (now called defer) components, without having to use the <em>Angular<\/em> router's <code>loadChildren<\/code> (for a <em>module<\/em> or an array of <em>components<\/em>) or <code>loadComponent<\/code> (for just one <em>standalone component<\/em>). Since <em>Angular 13<\/em> we didn't need a <code>ComponentFactoryResolver<\/code> to create the component anymore, but we still had to use a <code>ViewContainerRef<\/code> and something like an <code>async \/ await<\/code> block to dynamically load, create and insert the component into the DOM.<\/p>\n<p>With <code>@defer<\/code> we now have an elegant and intuitive option to <strong>delay the loading of components<\/strong> until they are needed. This is especially useful for components that are not visible on the initial screen (so-called <strong>above-the-fold<\/strong>) of our web app. The <code>@defer<\/code> feature has the largest impact if we can use it for heavy components that include large third party packages like <strong>feature-rich tables<\/strong>, <strong>charts<\/strong> or some <strong>export<\/strong> functionality (e.g. PDF generator), because those packages can then also be deferred and thus excluded from the eagerly loaded main bundle.<\/p>\n<h2>Why is Initial Load Performance so important?<\/h2>\n<p>We recently blogged about <a href=\"https:\/\/www.angulararchitects.io\/blog\/why-is-initial-load-performance-so-important\/\">Why Initial Load Performance is so important<\/a>, focussing on SSR.<br \/>\nDeferrable Views, also known as <code>@defer<\/code> blocks, are a lightweight innovation to reduce the initial bundle size and thus further improve the Initial Load Performance of our <em>Angular<\/em> app.<\/p>\n<p>We also wrote about <a href=\"https:\/\/www.angulararchitects.io\/blog\/how-to-measure-initial-load-performance\/\">how to measure the Initial Load Performance<\/a>.<br \/>\nDeferring some of your components should specifically improve <strong>First Contentful Paint (FCP)<\/strong>, <strong>Largest Contentful Paint (LCP)<\/strong> and even <strong>Time to First Byte (TTFB)<\/strong>.<br \/>\nHowever, be careful not to increase the <strong>Cumulative Layout Shift (CLS)<\/strong> by deferring components that are visible on the initial above-the-fold screen.<br \/>\nYou can achieve this by using <strong>placeholders<\/strong> (see below for <code>@placeholder<\/code> and <code>@loading<\/code>) with fixed width and height properties - just like you'd do for lazy loading images with the help of <code>NgOptimizeImage<\/code>.<\/p>\n<h2>How to dynamically load components with Angular 13 - 16<\/h2>\n<p>In my <a href=\"https:\/\/www.angulararchitects.io\/en\/angular-workshops\/angular-performance-workshop\/\"><strong>Performance Workshop<\/strong><\/a> \ud83d\ude80 I always show(ed) how to dynamically load components with <em>Angular 13 - 16<\/em>.<\/p>\n<p>Firstly, we need to get a <code>ViewContainerRef<\/code> in the components view template. Since we don't want to create an HTML element, we use an <code>ng-container<\/code>:<\/p>\n<pre><code class=\"language-html\">&lt;ng-container #viewContainer \/&gt;<\/code><\/pre>\n<p>Important note: Since <em>Angular 15.1.0<\/em> we can use self-closing tags in <em>Angular<\/em> - also for components without content.<\/p>\n<p>Secondly, we need to fetch the <code>ViewContainerRef<\/code> via a <code>@ViewChild<\/code> using the template reference <code>#viewContainer<\/code> in the component class:<\/p>\n<pre><code class=\"language-ts\">@ViewChild(&#039;viewContainer&#039;, { read: ViewContainerRef }) viewContainerRef!: ViewContainerRef;<\/code><\/pre>\n<p>Thirdly, we can use <code>async \/ await<\/code> to dynamically import a component and insert it into the DOM:<\/p>\n<pre><code class=\"language-ts\">async ngAfterViewInit() {\n  const { LazyComponent } = await import(&#039;.\/lazy\/lazy.component&#039;);\n  const lazyComponentRef = this.viewContainerRef.createComponent(LazyComponent);\n}<\/code><\/pre>\n<p>As a result the <em>Angular Compiler<\/em> will create a new chunk for the <code>LazyComponent<\/code> and the app (well, the browser) will load the bundle on demand.<\/p>\n<p>While this is still a working approach, it is a bit heavyweight and less powerful than using the new <code>@defer<\/code> syntax.<\/p>\n<p>Important note: To fully support deferring our <code>LazyComponent<\/code> must be a <em>standalone component<\/em>.<\/p>\n<h2>How to dynamically load components with Angular 17's @defer<\/h2>\n<p>With <em>Angular 17<\/em> we can use the fancy <code>@defer<\/code> syntax. The syntax is very similar to the new <code>@if<\/code> and much, much easier to use:<\/p>\n<pre><code class=\"language-html\">@defer {\n  &lt;aa-lazy-component \/&gt;\n}<\/code><\/pre>\n<p>That's all there is to it \ud83e\udd73 - the <em>Angular Compiler<\/em> will again create a new chunk for the <code>LazyComponent<\/code> and the app (again, the browser) will load the bundle on demand.<\/p>\n<p>But that's not the end of the story (nor this post \ud83d\ude09). We can additionally leverage the control of the lazy loading process by using built-in and even our own <strong>triggers<\/strong>.<\/p>\n<h2>Triggers<\/h2>\n<p>The <code>@defer<\/code> block in the provided context is used to replace placeholder content with lazily loaded content.<\/p>\n<p>Two options for triggering this swap are specified: <code>on<\/code> and <code>when<\/code>.<\/p>\n<h3><code>on<\/code><\/h3>\n<p><code>on<\/code> specifies built-in trigger conditions using events like interaction or viewport.<\/p>\n<pre><code class=\"language-html\">@defer (on viewport) {\n  &lt;aa-lazy-component \/&gt;\n}<\/code><\/pre>\n<p>A list of <code>on<\/code> events provided in <em>Angular 17<\/em>:<\/p>\n<ul>\n<li>\n<p><code>on idle<\/code> triggers once the browser has reached an idle state (detected using the <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Window\/requestIdleCallback\">requestIdleCallback API<\/a>).<br \/>\nThis is the default behavior with a defer block, so no need to write it explicitly.<\/p>\n<pre><code class=\"language-html\">@defer {\n    &lt;aa-lazy-component \/&gt;\n}<\/code><\/pre>\n<\/li>\n<li>\n<p><code>on viewport<\/code> triggers when the specified content enters the viewport (using the <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Intersection_Observer_API\">IntersectionObserver API<\/a>).<br \/>\nThis could be the placeholder content.<\/p>\n<pre><code class=\"language-html\">@defer (on viewport) {\n    &lt;aa-lazy-component \/&gt;\n} @placeholder {\n    &lt;img width=&quot;420&quot; height=&quot;420&quot; alt=&quot;lazy placeholder&quot; src=&quot;placeholder.avif&quot; \/&gt;\n}<\/code><\/pre>\n<ul>\n<li>Alternatively, you can specify a template reference <code>#variable<\/code>.<\/li>\n<\/ul>\n<pre><code class=\"language-html\">&lt;div #viewportVariable&gt;Hello!&lt;\/div&gt;\n\n@defer (on viewport(viewportVariable)) {\n    &lt;aa-lazy-component \/&gt;\n}<\/code><\/pre>\n<\/li>\n<li>\n<p><code>on interaction<\/code> triggers when the user interacts with the specified element through <code>click<\/code> or <code>keydown<\/code> events.<\/p>\n<pre><code class=\"language-html\">@defer (on interaction) {\n    &lt;aa-lazy-component \/&gt;\n}<\/code><\/pre>\n<ul>\n<li>Alternatively, you can also specify a template reference <code>#variable<\/code>.<\/li>\n<\/ul>\n<pre><code class=\"language-html\">&lt;button #interactionVariable&gt;Hello!&lt;\/button&gt;\n\n@defer (on interaction(interactionVariable)) {\n    &lt;aa-lazy-component \/&gt;\n}<\/code><\/pre>\n<\/li>\n<li>\n<p><code>on hover<\/code> triggers on hover (actually <code>mouseenter<\/code> or <code>focusin<\/code>).<\/p>\n<pre><code class=\"language-html\">@defer (on hover) {\n    &lt;aa-lazy-component \/&gt;\n}<\/code><\/pre>\n<ul>\n<li>Alternatively, you can again specify a template reference <code>#variable<\/code>.<\/li>\n<\/ul>\n<pre><code class=\"language-html\">&lt;div #hoverVariable&gt;Hello!&lt;\/div&gt;\n\n@defer (on viewport(hoverVariable)) {\n    &lt;aa-lazy-component \/&gt;\n}<\/code><\/pre>\n<\/li>\n<li>\n<p><code>on immediate<\/code> triggers the deferred load immediately. Once the client has finished rendering, the defer chunk will start fetching right away. This is similar to a <code>setTimeout<\/code> with a timeout of <code>0<\/code>.<\/p>\n<pre><code class=\"language-html\">@defer (on immediate) {\n    &lt;aa-lazy-component \/&gt;\n}<\/code><\/pre>\n<\/li>\n<li>\n<p><code>on timer<\/code> triggers after a timeout in <code>ms<\/code> or <code>s<\/code>, working like <code>setTimeout<\/code> once the client has finished rendering.<\/p>\n<pre><code class=\"language-html\">@defer (on timer(4200ms)) {\n    &lt;aa-lazy-component \/&gt;\n}<\/code><\/pre>\n<\/li>\n<\/ul>\n<h3><code>when<\/code><\/h3>\n<p><code>when<\/code> specifies an imperative condition as an expression that returns a boolean. If the condition returns to false, the swap is not reverted; it is a one-time operation.<\/p>\n<pre><code class=\"language-ts\">class WhenDemoComponent {\n  condition = false;\n\n  trigger() {\n    this.condition = true;\n  }\n}<\/code><\/pre>\n<pre><code class=\"language-html\">@defer (when condition) {\n  &lt;aa-lazy-component \/&gt;\n}<\/code><\/pre>\n<p>Multiple <code>when<\/code> and <code>on<\/code> triggers can be used together in a statement. They are always OR conditions so the swap occurs if either condition is met.<\/p>\n<h2>Additional features of the defer block<\/h2>\n<p>Beyond easily specifying <strong>triggers<\/strong>, the <code>@defer<\/code> block offers the following useful features:<\/p>\n<h3><code>prefetch<\/code><\/h3>\n<p><code>@defer<\/code> allows to specify conditions <strong>when prefetching of the dependencies should be triggered<\/strong>.<\/p>\n<p>It works similarly to the main defer conditions, and accepts <code>when<\/code> and\/or <code>on<\/code> to declare the trigger.<\/p>\n<p>In this example, the prefetching starts when a browser becomes idle.<\/p>\n<pre><code class=\"language-html\">@defer (on viewport; prefetch on idle) {\n  &lt;aa-lazy-component \/&gt;\n}<\/code><\/pre>\n<h3><code>@placeholder<\/code><\/h3>\n<p>A placeholder content to be displayed <strong>until the <code>@defer<\/code> block is loading<\/strong>.<\/p>\n<p>By default, defer blocks remain inactive until triggered. The optional <code>@placeholder<\/code> block displays content before activation, which is then replaced by the main content after loading. Note that placeholder block dependencies are eagerly loaded, and various content types are supported.<\/p>\n<p>Important note: When rendering an application on the server (either using <strong>SSR<\/strong> or prerendering, now called <strong>SSG<\/strong>), <code>@defer<\/code> blocks will ignore triggers and always render the <code>@placeholder<\/code> (or nothing if no placeholder is specified).<\/p>\n<pre><code class=\"language-html\">@defer (on viewport; prefetch on idle) {\n  &lt;aa-lazy-component \/&gt;\n} @placeholder (minimum 500ms) {\n  &lt;img width=&quot;420&quot; height=&quot;420&quot; alt=&quot;lazy placeholder&quot; src=&quot;placeholder.avif&quot; \/&gt;\n}<\/code><\/pre>\n<p>The <code>@placeholder<\/code> block accepts an optional <code>minimum<\/code> parameter to specify the amount of time that it should be shown.<\/p>\n<h3><code>@loading<\/code><\/h3>\n<p>A loading content to be shown to users <strong>while the <code>@defer<\/code> block is loading<\/strong>.<\/p>\n<p>The optional <code>@loading<\/code> allows you to declare content that will be shown during the loading of any deferred dependencies. For example, you could show a loading spinner. Similar to <code>@placeholder<\/code>, the dependencies of the <code>@loading<\/code> block are eagerly loaded.<\/p>\n<pre><code class=\"language-html\">@defer (on viewport; prefetch on idle) {\n  &lt;aa-lazy-component \/&gt;\n} @placeholder (minimum 500ms) {\n  &lt;img width=&quot;420&quot; height=&quot;420&quot; alt=&quot;lazy component placeholder&quot; src=&quot;placeholder.avif&quot; \/&gt;\n} @loading (after 500ms; minimum 1s) {\n  &lt;img width=&quot;420&quot; height=&quot;420&quot; alt=&quot;lazy is loading spinner&quot; src=&quot;spinner.avif&quot; \/&gt;\n}<\/code><\/pre>\n<p>Just like <code>@placeholder<\/code>, <code>after<\/code> and <code>minimum<\/code> exist to prevent fast flickering.<\/p>\n<h3><code>@error<\/code><\/h3>\n<p>An error content to be displayed in case the <code>@defer<\/code> block encounters an <strong>error during loading<\/strong>.<\/p>\n<p>The optional <code>@error<\/code> allows you to declare content that will be shown if deferred loading fails.<\/p>\n<pre><code class=\"language-html\">@defer (on viewport; prefetch on idle) {\n  &lt;aa-lazy-component \/&gt;\n} @placeholder (minimum 500ms) {\n  &lt;img width=&quot;420&quot; height=&quot;420&quot; alt=&quot;lazy component placeholder&quot; src=&quot;placeholder.avif&quot; \/&gt;\n} @loading (after 500ms; minimum 1s) {\n  &lt;img width=&quot;420&quot; height=&quot;420&quot; alt=&quot;lazy is loading spinner&quot; src=&quot;spinner.avif&quot; \/&gt;\n} @error {\n  &lt;p&gt;Why do I exist?&lt;\/p&gt;\n}<\/code><\/pre>\n<h2>Automated control-flow migration<\/h2>\n<p>I also want to mention that one of the Angular teams' goals of the built-in control flow was to enable completely automated migration. Give it a try in your app:<\/p>\n<p><code>ng update<\/code><\/p>\n<p><code>ng g @angular\/core:control-flow<\/code><\/p>\n<p>And now make sure to try out the new <code>@defer<\/code> block feature \ud83d\udc4f<\/p>\n<h2>Conclusion<\/h2>\n<p><em>Angular 17's<\/em> introduction of <em>Deferrable Views<\/em>, particularly the new <code>@defer<\/code> block syntax, marks a significant leap in simplifying the dynamic loading of <em>standalone components<\/em>. <code>@defer<\/code> not only streamlines the process but also enhances Initial Load Performance by deferring heavy components, such as those with large third-party packages, until they are needed.<\/p>\n<p>Leveraging the built-in <code>on<\/code> and custom <code>when<\/code> triggers along with the <code>prefetch<\/code> feature and the <code>@placeholder<\/code>, <code>@loading<\/code> and <code>@error<\/code> states, further empowers developers to optimize the user experience with a more responsive and efficient web application.<\/p>\n<h2>References<\/h2>\n<ul>\n<li><a href=\"https:\/\/www.angulararchitects.io\/blog\/whats-new-in-angular-17\/\">What's new in Angular 17<\/a> by Manfred Steyer<\/li>\n<li><a href=\"https:\/\/blog.angular.io\/introducing-angular-v17-4d7033312e4b\">Introducing Angular 17<\/a> by Minko Gechev<\/li>\n<li><a href=\"https:\/\/angular.io\/guide\/defer\">Deferrable Views<\/a> with Jessica Janiuk on Angular YouTube<\/li>\n<li><a href=\"https:\/\/angular.io\/guide\/defer\">Deferrable Views<\/a> in the Angular Docs<\/li>\n<\/ul>\n<h2>Performance Deep Dive Workshop<\/h2>\n<p>If you want to deep dive into Angular performance, we offer a dedicated <a href=\"https:\/\/www.angulararchitects.io\/en\/angular-workshops\/angular-performance-workshop\/\"><strong>Performance Workshop<\/strong><\/a> \ud83d\ude80 - both in English and German.<\/p>\n<p>This post was written by <a href=\"https:\/\/alex.thalhammer.name\/\">Alexander Thalhammer<\/a>. Follow me on <a href=\"https:\/\/at.linkedin.com\/in\/thalhammer\">Linkedin<\/a>, <a href=\"https:\/\/twitter.com\/LX_T\">X<\/a> or <a href=\"https:\/\/github.com\/L-X-T\">giThub<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is post 4 of 6 in the series &ldquo;Performance Optimization&rdquo; Why is Initial Load Performance so Important? How to measure Initial Load Performance How to use Angular SSR with Hydration Improve Initial Load Time with Deferrable Views How to @defer 3rd party dependencies Updated: Guide for Server-Side Rendering (SSR) in Angular Besides some minor [&hellip;]<\/p>\n","protected":false},"author":21,"featured_media":23452,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_price":"","_stock":"","_tribe_ticket_header":"","_tribe_default_ticket_provider":"","_ticket_start_date":"","_ticket_end_date":"","_tribe_ticket_show_description":"","_tribe_ticket_show_not_going":false,"_tribe_ticket_use_global_stock":"","_tribe_ticket_global_stock_level":"","_global_stock_mode":"","_global_stock_cap":"","_tribe_rsvp_for_event":"","_tribe_ticket_going_count":"","_tribe_ticket_not_going_count":"","_tribe_tickets_list":"[]","_tribe_ticket_has_attendee_info_fields":false,"footnotes":""},"categories":[18],"tags":[],"class_list":["post-23455","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","post_series-performance-pptimization"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Improve Initial Load Time with Deferrable Views - ANGULARarchitects<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Blog: How to improve Initial Load Performance with Angular 17&#039;s Deferrable Views\" \/>\n<meta property=\"og:description\" content=\"This is post 4 of 6 in the series &ldquo;Performance Optimization&rdquo; Why is Initial Load Performance so Important? How to measure Initial Load Performance How to use Angular SSR with Hydration Improve Initial Load Time with Deferrable Views How to @defer 3rd party dependencies Updated: Guide for Server-Side Rendering (SSR) in Angular Besides some minor [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/\" \/>\n<meta property=\"og:site_name\" content=\"ANGULARarchitects\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-15T21:43:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-24T19:47:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/11\/shutterstock_2308145041.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"500\" \/>\n\t<meta property=\"og:image:height\" content=\"280\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Alexander Thalhammer\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@LX_T\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alexander Thalhammer\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/\"},\"author\":{\"name\":\"Alexander Thalhammer\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#\/schema\/person\/eefb0cd4d115dfd406a02b6dbc760d45\"},\"headline\":\"Improve Initial Load Time with Deferrable Views\",\"datePublished\":\"2023-11-15T21:43:13+00:00\",\"dateModified\":\"2025-03-24T19:47:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/\"},\"wordCount\":1284,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/11\/shutterstock_2308145041.jpg\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/\",\"url\":\"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/\",\"name\":\"Improve Initial Load Time with Deferrable Views - ANGULARarchitects\",\"isPartOf\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/11\/shutterstock_2308145041.jpg\",\"datePublished\":\"2023-11-15T21:43:13+00:00\",\"dateModified\":\"2025-03-24T19:47:02+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/#primaryimage\",\"url\":\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/11\/shutterstock_2308145041.jpg\",\"contentUrl\":\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/11\/shutterstock_2308145041.jpg\",\"width\":500,\"height\":280},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.angulararchitects.io\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Improve Initial Load Time with Deferrable Views\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#website\",\"url\":\"https:\/\/www.angulararchitects.io\/en\/\",\"name\":\"ANGULARarchitects\",\"description\":\"AngularArchitects.io\",\"publisher\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.angulararchitects.io\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#organization\",\"name\":\"ANGULARarchitects\",\"alternateName\":\"SOFTWAREarchitects\",\"url\":\"https:\/\/www.angulararchitects.io\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/07\/AA-Logo-RGB-horizontal-inside-knowledge-black.svg\",\"contentUrl\":\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/07\/AA-Logo-RGB-horizontal-inside-knowledge-black.svg\",\"width\":644,\"height\":216,\"caption\":\"ANGULARarchitects\"},\"image\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/github.com\/angular-architects\",\"https:\/\/www.linkedin.com\/company\/angular-architects\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#\/schema\/person\/eefb0cd4d115dfd406a02b6dbc760d45\",\"name\":\"Alexander Thalhammer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/23f1b6f9b1ee7d04247b8320851762347d56c76b1537d100d07390d6d919b78d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/23f1b6f9b1ee7d04247b8320851762347d56c76b1537d100d07390d6d919b78d?s=96&d=mm&r=g\",\"caption\":\"Alexander Thalhammer\"},\"sameAs\":[\"https:\/\/x.com\/LX_T\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Improve Initial Load Time with Deferrable Views - ANGULARarchitects","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/","og_locale":"en_US","og_type":"article","og_title":"Blog: How to improve Initial Load Performance with Angular 17's Deferrable Views","og_description":"This is post 4 of 6 in the series &ldquo;Performance Optimization&rdquo; Why is Initial Load Performance so Important? How to measure Initial Load Performance How to use Angular SSR with Hydration Improve Initial Load Time with Deferrable Views How to @defer 3rd party dependencies Updated: Guide for Server-Side Rendering (SSR) in Angular Besides some minor [&hellip;]","og_url":"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/","og_site_name":"ANGULARarchitects","article_published_time":"2023-11-15T21:43:13+00:00","article_modified_time":"2025-03-24T19:47:02+00:00","og_image":[{"width":500,"height":280,"url":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/11\/shutterstock_2308145041.jpg","type":"image\/jpeg"}],"author":"Alexander Thalhammer","twitter_card":"summary_large_image","twitter_creator":"@LX_T","twitter_misc":{"Written by":"Alexander Thalhammer","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/#article","isPartOf":{"@id":"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/"},"author":{"name":"Alexander Thalhammer","@id":"https:\/\/www.angulararchitects.io\/en\/#\/schema\/person\/eefb0cd4d115dfd406a02b6dbc760d45"},"headline":"Improve Initial Load Time with Deferrable Views","datePublished":"2023-11-15T21:43:13+00:00","dateModified":"2025-03-24T19:47:02+00:00","mainEntityOfPage":{"@id":"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/"},"wordCount":1284,"commentCount":0,"publisher":{"@id":"https:\/\/www.angulararchitects.io\/en\/#organization"},"image":{"@id":"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/#primaryimage"},"thumbnailUrl":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/11\/shutterstock_2308145041.jpg","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/","url":"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/","name":"Improve Initial Load Time with Deferrable Views - ANGULARarchitects","isPartOf":{"@id":"https:\/\/www.angulararchitects.io\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/#primaryimage"},"image":{"@id":"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/#primaryimage"},"thumbnailUrl":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/11\/shutterstock_2308145041.jpg","datePublished":"2023-11-15T21:43:13+00:00","dateModified":"2025-03-24T19:47:02+00:00","breadcrumb":{"@id":"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/#primaryimage","url":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/11\/shutterstock_2308145041.jpg","contentUrl":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/11\/shutterstock_2308145041.jpg","width":500,"height":280},{"@type":"BreadcrumbList","@id":"https:\/\/www.angulararchitects.io\/en\/blog\/deferrable-views\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.angulararchitects.io\/en\/"},{"@type":"ListItem","position":2,"name":"Improve Initial Load Time with Deferrable Views"}]},{"@type":"WebSite","@id":"https:\/\/www.angulararchitects.io\/en\/#website","url":"https:\/\/www.angulararchitects.io\/en\/","name":"ANGULARarchitects","description":"AngularArchitects.io","publisher":{"@id":"https:\/\/www.angulararchitects.io\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.angulararchitects.io\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.angulararchitects.io\/en\/#organization","name":"ANGULARarchitects","alternateName":"SOFTWAREarchitects","url":"https:\/\/www.angulararchitects.io\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.angulararchitects.io\/en\/#\/schema\/logo\/image\/","url":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/07\/AA-Logo-RGB-horizontal-inside-knowledge-black.svg","contentUrl":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/07\/AA-Logo-RGB-horizontal-inside-knowledge-black.svg","width":644,"height":216,"caption":"ANGULARarchitects"},"image":{"@id":"https:\/\/www.angulararchitects.io\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/github.com\/angular-architects","https:\/\/www.linkedin.com\/company\/angular-architects\/"]},{"@type":"Person","@id":"https:\/\/www.angulararchitects.io\/en\/#\/schema\/person\/eefb0cd4d115dfd406a02b6dbc760d45","name":"Alexander Thalhammer","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.angulararchitects.io\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/23f1b6f9b1ee7d04247b8320851762347d56c76b1537d100d07390d6d919b78d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/23f1b6f9b1ee7d04247b8320851762347d56c76b1537d100d07390d6d919b78d?s=96&d=mm&r=g","caption":"Alexander Thalhammer"},"sameAs":["https:\/\/x.com\/LX_T"]}]}},"_links":{"self":[{"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/posts\/23455","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/comments?post=23455"}],"version-history":[{"count":10,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/posts\/23455\/revisions"}],"predecessor-version":[{"id":29338,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/posts\/23455\/revisions\/29338"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/media\/23452"}],"wp:attachment":[{"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/media?parent=23455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/categories?post=23455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/tags?post=23455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}