<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[GDG Siliguri]]></title><description><![CDATA[GDG Siliguri]]></description><link>https://gdgsiliguri.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sun, 08 Nov 2026 08:18:01 GMT</lastBuildDate><atom:link href="https://gdgsiliguri.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[An Introduction to Object Oriented Programming in Dart]]></title><description><![CDATA[This blog was written by Amarjit Malick. He is currently working at Cloudcraftz as an Associate Software Developer. He has over 2+ years of experience on…]]></description><link>https://gdgsiliguri.hashnode.dev/an-introduction-to-object-oriented-programming-in-dart</link><guid isPermaLink="true">https://gdgsiliguri.hashnode.dev/an-introduction-to-object-oriented-programming-in-dart</guid><category><![CDATA[Flutter]]></category><category><![CDATA[Dart]]></category><category><![CDATA[Flutter Examples]]></category><category><![CDATA[#dart language]]></category><category><![CDATA[#dart-for-beginners]]></category><category><![CDATA[dart programming tutorial]]></category><dc:creator><![CDATA[GDG Siliguri]]></dc:creator><pubDate>Sat, 28 Dec 2024 04:30:44 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1735328040014/3cabd501-12ee-47ac-acb2-56a22c014219.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-about-the-author"><strong>About the Author</strong></h2>
<p>This blog was written by <a target="_blank" href="https://www.linkedin.com/in/amarjit-mallick/">Amarjit Malick</a><strong>.</strong> He is currently working at <strong>Cloudcraftz</strong> as an <strong>Associate Software Developer</strong>. He has over 2+ years of experience on working on <strong>Flutter</strong> and <strong>App development</strong>. We’re grateful to have him share his insights and knowledge about <strong>Flutter</strong> with our community. If you want to know more about <strong>Amarjit,</strong> check out his <a target="_blank" href="https://www.linkedin.com/in/amarjit-mallick/"><strong>LinkedIn</strong></a> profile.</p>
<h2 id="heading-introduction"><strong>Introduction</strong></h2>
<p><strong>Object Oriented Programming</strong> is one of the most popular and widely used programming paradigms. In this article, we are going to understand how Object Oriented Programming concepts are being implemented in <strong>Dart</strong>. After reading this article, you can start your journey as a <strong>Flutter Developer</strong> and will have a good understanding of the basics of <strong>Dart</strong>.</p>
<h2 id="heading-what-is-object-oriented-programming"><strong>What is Object Oriented Programming?</strong></h2>
<p>From the name, we can easily understand that it is a programming pattern that rounds around an object or entity. An object can be defined as a data field that has unique attributes and behaviour.</p>
<h2 id="heading-building-blocks-of-object-oriented-programming">Building Blocks of Object Oriented Programming</h2>
<h3 id="heading-class">Class</h3>
<p>A user-defined data type that acts as the blueprint for individual objects, attributes, and methods.</p>
<p><em>classes are logical entities, not data structure</em></p>
<pre><code class="lang-dart"><span class="hljs-comment">//example of a class</span>
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Person</span> </span>{
  <span class="hljs-built_in">String</span> name;
  <span class="hljs-built_in">int</span> age;

  <span class="hljs-keyword">void</span> sayHello() {
    <span class="hljs-built_in">print</span>(<span class="hljs-string">'Hello, my name is <span class="hljs-subst">$name</span> and I am <span class="hljs-subst">$age</span> years old.'</span>);
  }
}
</code></pre>
<h3 id="heading-object">Object</h3>
<p>An instance of a class created with specifically defined data. It is a real-world entity that has attributes, behaviour, and properties. Object contains member functions, variables that we have defined in the class.</p>
<pre><code class="lang-dart">Person person = <span class="hljs-keyword">new</span> Person();
person.name = <span class="hljs-string">'John'</span>;
person.age = <span class="hljs-number">30</span>;
person.sayHello();
</code></pre>
<h3 id="heading-methods">Methods</h3>
<p>A Method is a function defined inside a class that describes the behaviour of an object.</p>
<pre><code class="lang-dart"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Person</span> </span>{
  <span class="hljs-built_in">String</span> name;
  <span class="hljs-built_in">int</span> age;

<span class="hljs-comment">//example of method</span>
  <span class="hljs-keyword">void</span> sayHello() {
    <span class="hljs-built_in">print</span>(<span class="hljs-string">'Hello, my name is <span class="hljs-subst">$name</span> and I am <span class="hljs-subst">$age</span> years old.'</span>);
  }
}
</code></pre>
<h3 id="heading-attributes">Attributes</h3>
<p>Objects will have data stored in the attributes field. Class attributes belong to the class itself.</p>
<pre><code class="lang-dart"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Person</span> </span>{
<span class="hljs-comment">//attributes</span>
  <span class="hljs-built_in">String</span> name;
  <span class="hljs-built_in">int</span> age;

  <span class="hljs-keyword">void</span> sayHello() {
    <span class="hljs-built_in">print</span>(<span class="hljs-string">'Hello, my name is <span class="hljs-subst">$name</span> and I am <span class="hljs-subst">$age</span> years old.'</span>);
  }
}
</code></pre>
<h2 id="heading-main-principles-of-object-oriented-programming"><strong>Main Principles of Object Oriented Programming</strong></h2>
<p>OOP rests on the following four pillars:</p>
<h3 id="heading-encapsulation">Encapsulation</h3>
<p><strong>Encapsulation</strong> means the action of enclosing something. In OOP, Encapsulation is the concept of hiding the implementation details of a class from its users.</p>
<p>D<strong>art</strong> does not have keywords for restricting access, such as <em>private</em>, <em>public</em>, and <em>protected</em>. Any identifier that starts with an underscore <code>_</code> is <strong>private</strong> to its library.</p>
<pre><code class="lang-dart"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">BankAccount</span> </span>{
  <span class="hljs-built_in">String</span> _accountNumber; <span class="hljs-comment">// private variable</span>
  <span class="hljs-built_in">double</span> _balance; <span class="hljs-comment">// private variable</span>

  BankAccount(<span class="hljs-keyword">this</span>._accountNumber, <span class="hljs-keyword">this</span>._balance); <span class="hljs-comment">// constructor</span>
}
</code></pre>
<h3 id="heading-abstraction">Abstraction</h3>
<p>In OOPs, <strong>Abstraction</strong> is like taking away / abstracting out some common functionalities. Objects only reveal internal mechanisms that are relevant for the use of other objects, hiding any unnecessary implementation code. The derived class can have its functionality extended.</p>
<pre><code class="lang-dart"><span class="hljs-keyword">abstract</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Shape</span> </span>{
  <span class="hljs-built_in">double</span> getArea();
  <span class="hljs-built_in">double</span> getPerimeter();
}

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Rectangle</span> <span class="hljs-keyword">implements</span> <span class="hljs-title">Shape</span> </span>{
  <span class="hljs-keyword">final</span> <span class="hljs-built_in">double</span> _length;
  <span class="hljs-keyword">final</span> <span class="hljs-built_in">double</span> _width;

  Rectangle(<span class="hljs-keyword">this</span>._length, <span class="hljs-keyword">this</span>._width);

  <span class="hljs-meta">@override</span>
  <span class="hljs-built_in">double</span> getArea() {
    <span class="hljs-keyword">return</span> _length * _width;
  }

  <span class="hljs-meta">@override</span>
  <span class="hljs-built_in">double</span> getPerimeter() {
    <span class="hljs-keyword">return</span> <span class="hljs-number">2</span> * (_length + _width);
  }
}

<span class="hljs-keyword">void</span> main() {
    Shape shape = Rectangle(<span class="hljs-number">10.0</span>, <span class="hljs-number">5.0</span>);
    <span class="hljs-built_in">print</span>(<span class="hljs-string">'Area: <span class="hljs-subst">${shape.getArea()}</span>'</span>);
    <span class="hljs-built_in">print</span>(<span class="hljs-string">'Perimeter: <span class="hljs-subst">${shape.getPerimeter()}</span>'</span>);
}
</code></pre>
<h3 id="heading-inheritance">Inheritance</h3>
<p><strong>Inheritance</strong> means the ability to create new classes from an existing one, more simply, to inherit something from the other class.</p>
<p>In Dart, we can create a subclass by extending a base class using the <code>extends</code> keyword.</p>
<p><em>Dart does not support multiple inheritance.</em></p>
<pre><code class="lang-dart"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Person</span> </span>{
  <span class="hljs-built_in">String?</span> name;
  <span class="hljs-built_in">int?</span> age;

  <span class="hljs-keyword">void</span> sayHello() {
    <span class="hljs-built_in">print</span>(<span class="hljs-string">'Hello, my name is <span class="hljs-subst">$name</span> and I am <span class="hljs-subst">$age</span> years old.'</span>);
  }
}

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Student</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Person</span> </span>{
  <span class="hljs-built_in">String?</span> school;

  <span class="hljs-keyword">void</span> study() {
    <span class="hljs-built_in">print</span>(<span class="hljs-string">'<span class="hljs-subst">$name</span> is studying at <span class="hljs-subst">$school</span>.'</span>);
  }
}

<span class="hljs-keyword">void</span> main() {
  Student student = Student();
  student.name = <span class="hljs-string">'Mary'</span>;
  student.age = <span class="hljs-number">20</span>;
  student.school = <span class="hljs-string">'ABC University'</span>;
  student.sayHello();
  student.study();
}
</code></pre>
<h3 id="heading-polymorphism">Polymorphism</h3>
<p><strong>Poly</strong> means many and <strong>morphs</strong> means forms. <strong>Polymorphism</strong> is achieved through inheritance and it represents an object's ability to copy another object's behaviour. Subclasses or child classes usually override instance methods, getters, and setters.</p>
<p>We can use <code>@override</code> to indicate that we are overriding a member.</p>
<p><em>Dart does not support method overloading.</em></p>
<pre><code class="lang-dart"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Animal</span> </span>{
  <span class="hljs-keyword">void</span> makeSound() {
    <span class="hljs-built_in">print</span>(<span class="hljs-string">'Animal makes a sound.'</span>);
  }
}

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Dog</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Animal</span> </span>{
  <span class="hljs-meta">@override</span>
  <span class="hljs-keyword">void</span> makeSound() {
      <span class="hljs-built_in">print</span>(<span class="hljs-string">'Dog barks.'</span>);
  }
}

<span class="hljs-keyword">void</span> main() {
  Animal animal = Animal();
  Dog dog = Dog();

  animal.makeSound();
  dog.makeSound();
}
</code></pre>
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<p>Thank You for reading this article. Hope you have gained some basic idea of how OOPs concepts are used in <strong>Dart</strong>. After reading this article, try to implement the example code by yourself. To learn more about <strong>Dart</strong> check the official documentation <a target="_blank" href="https://dart.dev/">here</a>. If you like this blog and want to learn more about software engineering and related topics then follow <strong>GDG Siliguri</strong> on <strong>hashnode</strong>.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding the Critical Render Path and Its Role in Web Performance]]></title><description><![CDATA[This blog was written by Sagnik Ghosh. He is currently working at P360 as a Software Engineer. He has over 2+ years of experience on working on web…]]></description><link>https://gdgsiliguri.hashnode.dev/understanding-the-critical-render-path-and-its-role-in-web-performance</link><guid isPermaLink="true">https://gdgsiliguri.hashnode.dev/understanding-the-critical-render-path-and-its-role-in-web-performance</guid><category><![CDATA[web performance]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[webdev]]></category><dc:creator><![CDATA[GDG Siliguri]]></dc:creator><pubDate>Tue, 17 Dec 2024 07:00:12 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1734374044018/1b6db325-27ee-43c5-b362-143041f2a934.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-about-the-author"><strong>About the Author</strong></h2>
<p>This blog was written by <a target="_blank" href="https://www.linkedin.com/in/sagnik-ghosh26/"><strong>Sagnik Ghosh</strong></a>. He is currently working at <strong>P360</strong> as a <strong>Software Engineer</strong>. He has over 2+ years of experience on working on web development and app development. We’re grateful to have him share his insights and knowledge about Web Performance with our community. If you want to know more about <strong>Sagnik,</strong> check out his <a target="_blank" href="https://www.linkedin.com/in/sagnik-ghosh26/">LinkedIn</a> profile.</p>
<h2 id="heading-introduction">Introduction</h2>
<p><strong>Web performance</strong> is a critical factor in modern web development, directly impacting user experience, engagement, and conversion rates. The <strong>Critical Render Path (CRP)</strong> is a core concept in optimizing web performance. By understanding and optimizing the CRP, developers can significantly improve the speed at which web pages load and become interactive. Let’s dive into what the CRP entails, why it matters, and how to optimize it based on insights from <a target="_blank" href="http://web.dev">web.dev</a>.</p>
<h2 id="heading-why-web-performance-matters">Why Web Performance Matters</h2>
<p><strong>Speed</strong> is at the heart of web performance. According to <a target="_blank" href="https://web.dev/learn/performance/why-speed-matters">web.dev</a>, fast-loading websites lead to better user engagement, retention, and overall satisfaction. Slow websites, on the other hand, frustrate users, leading to higher bounce rates and lost opportunities. Performance isn’t just about milliseconds, it’s about creating seamless experiences that respect users’ time.</p>
<p><strong>Google</strong> have spent some considerable amount of time creating user centric performance metrics which are known as Core Web Vitals. Here is a list of some case studies which highlights the connection between performance and business outcomes based on these core web vitals -</p>
<ul>
<li><p><a target="_blank" href="https://web.dev/case-studies/economic-times-cwv?authuser=1">How The Economic Times passed Core Web Vitals thresholds and achieved an overall 43% better bounce rate</a></p>
</li>
<li><p><a target="_blank" href="https://web.dev/case-studies/renault?authuser=1">How Renault improved its bounce and conversion rates by measuring and optimizing Largest Contentful Paint</a></p>
</li>
<li><p><a target="_blank" href="https://web.dev/case-studies/rakuten?authuser=1">How Rakuten 24's investment in Core Web Vitals increased revenue per visitor by 53.37% and conversion rate by 33.13%</a></p>
</li>
<li><p><a target="_blank" href="https://web.dev/case-studies/vodafone?authuser=1">Vodafone: A 31% improvement in LCP increased sales by 8%</a></p>
</li>
<li><p><a target="_blank" href="https://web.dev/case-studies/redbus-inp?authuser=1">How redBus improved their website's Interaction to Next Paint (INP) and increased sales by 7%</a></p>
</li>
</ul>
<h2 id="heading-the-role-of-the-critical-render-path">The Role of the Critical Render Path</h2>
<p>The Critical Render Path refers to the sequence of steps the browser takes to convert HTML, CSS, and JavaScript into pixels on the screen. Every web page has its unique CRP, influenced by the content structure, resource size, and dependencies. Optimizing the CRP ensures a faster path from the server to the user’s viewable content.</p>
<h3 id="heading-key-stages-in-the-critical-render-path"><em>Key Stages in the Critical Render Path</em></h3>
<ol>
<li><p><strong>HTML Parsing</strong>: The browser parses the HTML document to construct the Document Object Model (DOM).</p>
</li>
<li><p><strong>CSSOM Construction</strong>: The browser processes CSS files to build the CSS Object Model (CSSOM).</p>
</li>
<li><p><strong>JavaScript Execution</strong>: If the HTML references external or inline JavaScript, the browser may pause parsing to execute scripts.</p>
</li>
<li><p><strong>Render Tree Construction</strong>: The DOM and CSSOM combine to form the Render Tree, representing elements to be displayed with their styles.</p>
</li>
<li><p><strong>Layout and Paint</strong>: The browser calculates the layout of elements and paints pixels on the screen.</p>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1734373210110/0fc5ec6d-4abf-41d1-8dfd-aa86a0b2cde1.png" alt class="image--center mx-auto" /></p>
<p><em>(Content of this Image is sourced from</em> <a target="_blank" href="http://web.dev"><em>web.dev</em></a><a target="_blank" href="https://web.dev/"><em>)</em></a></p>
<p><a target="_blank" href="https://web.dev/">Only</a> after all these steps have been completed<a target="_blank" href="https://web.dev/">, will</a> the user see content on the screen. The critical rendering path focuses on the process outlined for the initial render, and depends on the critical resources necessary for it. And in between re-rendering happens multiple times as more resources which affect page's rendering becomes available to update what the user sees.</p>
<h2 id="heading-resources-on-the-critical-rendering-path">Resources on the Critical rendering path</h2>
<p>Here’s an overview of the resources that influence the critical rendering path and how browsers handle them -</p>
<h3 id="heading-1-critical-resources-for-initial-rendering"><em>1. Critical Resources for Initial Rendering</em></h3>
<p>The browser requires certain resources to complete the initial page render, including:</p>
<ul>
<li><p><strong>HTML</strong>: Key portions are processed as they arrive.</p>
</li>
<li><p><strong>Render-blocking CSS</strong>: Typically in the <code>&lt;head&gt;</code> element.</p>
</li>
<li><p><strong>Render-blocking JavaScript</strong>: Typically in the <code>&lt;head&gt;</code> element.</p>
</li>
</ul>
<h3 id="heading-2-what-the-browser-doesnt-wait-for"><em>2. What the Browser Doesn’t Wait For</em></h3>
<p>For efficiency, the browser doesn’t halt the initial render for:</p>
<ul>
<li><p><strong>All HTML</strong>: Rendering starts with the available portions.</p>
</li>
<li><p><strong>Fonts</strong>: Text may be temporarily invisible until fonts load.</p>
</li>
<li><p><strong>Images</strong>: Space may be reserved, but the browser moves forward.</p>
</li>
<li><p><strong>Non-render-blocking JavaScript</strong>: Often placed outside the <code>&lt;head&gt;</code> or marked as async or defer.</p>
</li>
<li><p><strong>Non-render-blocking CSS</strong>: Includes styles with media attributes irrelevant to the current viewport.</p>
</li>
</ul>
<h3 id="heading-3-the-role-of-the-element"><em>3. The Role of the</em> <code>&lt;head&gt;</code> Element</h3>
<p>The <code>&lt;head&gt;</code> contains metadata and critical resources that guide rendering. It does not include visible content but ensures the browser knows how to render the visible content in the <code>&lt;body&gt;</code>element.</p>
<h3 id="heading-4-render-blocking-resources"><em>4. Render-Blocking Resources</em></h3>
<p>Render-blocking resources pause rendering until they’re downloaded and processed:</p>
<ul>
<li><p><strong>CSS</strong>: Blocks rendering by default unless its media attribute makes it non-applicable to the current conditions.</p>
</li>
<li><p><strong>Recent Innovations</strong>: The <code>blocking=render</code> attribute allows developers to explicitly manage rendering-blocking elements.</p>
</li>
</ul>
<h2 id="heading-what-is-fouc">What is FOUC?</h2>
<p>CSS is considered a render-blocking resource because it prevents the browser from displaying any content until the CSS Object Model (CSSOM) is fully constructed. This behavior ensures a seamless user experience by avoiding a Flash of Unstyled Content (FOUC), where the page appears briefly without styling before the CSS is applied.</p>
<p>While FOUC is typically brief and may go unnoticed, understanding its implications is essential. The browser delays rendering to maintain a polished appearance, but prolonged render blocking can negatively impact performance. To address this, ensure your CSS is efficient and well-optimized to reduce the time it takes for the page to display fully styled content.</p>
<p>Here is a sample video clip of FOUC taken from <a target="_blank" href="https://web.dev/">web.dev</a> where you can see the page without any styling and all styles are applied once the page's CSS has finished loading from the network.<br /><a target="_blank" href="https://web.dev/static/learn/performance/optimize-resource-loading/video/fouc.webm?authuser=1">Example of FOUC</a></p>
<h3 id="heading-5-parser-blocking-resources"><em>5. Parser-Blocking Resources</em></h3>
<p>These resources halt the browser’s ability to parse HTML further:</p>
<ul>
<li><strong>JavaScript</strong>: By default, it blocks parsing unless marked <code>async</code> or <code>defer</code>. This ensures DOM and CSSOM stability before execution.</li>
</ul>
<p>Browsers mitigate parser blocking with techniques like the preload scanner, which downloads resources in advance to reduce delays.</p>
<h3 id="heading-6-identifying-blocking-resources"><em>6. Identifying Blocking Resources</em></h3>
<p>Tools like WebPageTest and Lighthouse help developers pinpoint performance bottlenecks:</p>
<ul>
<li><p><strong>WebPageTest</strong>: Marks render-blocking resources with an orange circle in its network waterfall diagram.</p>
</li>
<li><p><strong>Lighthouse</strong>: Highlights resources only if they delay rendering, avoiding false positives.</p>
</li>
</ul>
<h2 id="heading-optimizing-the-critical-render-path">Optimizing the Critical Render Path</h2>
<p>So now that we have understood what a Critical Rendering Path (CRP) is and how different resources affect it's path while rendering, It's time to know how to optimize the CRP for better web performance, ensuring faster page load times, and enhancing user experience. Below are key strategies to streamline the CRP -</p>
<h3 id="heading-1-efficient-html-structure"><em>1. Efficient HTML Structure</em></h3>
<p>As highlighted in <a target="_blank" href="https://web.dev/learn/performance/general-html-performance">General HTML Performance</a>, clean and semantic HTML is essential. Avoid excessive DOM depth and unnecessary elements, as they can complicate the rendering process. Use modern HTML standards to ensure compatibility and efficiency.</p>
<h3 id="heading-2-minimize-critical-resources"><em>2. Minimize Critical Resources</em></h3>
<p>Critical resources are those required to render the first paint of the page. To optimize their impact:</p>
<ul>
<li><p><strong>Eliminate unnecessary resources</strong>: Remove unused CSS, JavaScript, and large media files.</p>
</li>
<li><p><strong>Inline critical CSS</strong>: Embed only the CSS needed for above-the-fold content directly into the HTML.</p>
</li>
</ul>
<h3 id="heading-3-optimize-resource-loading"><em>3. Optimize Resource Loading</em></h3>
<p>Efficient resource loading can significantly reduce delays:</p>
<ul>
<li>Use <code>async</code> and <code>defer</code> for JavaScript: These attributes prevent JavaScript from blocking the parsing of HTML.</li>
</ul>
<blockquote>
<p><code>async</code>: Scripts load independently and execute as soon as they are ready.</p>
<p><code>defer</code>: Scripts load in order and execute after the HTML parsing is complete.</p>
</blockquote>
<ul>
<li><strong>Lazy-load non-critical resources</strong>: Images, videos, and other resources not immediately visible can be loaded only when needed.</li>
</ul>
<h3 id="heading-4-prioritize-critical-resources"><em>4. Prioritize Critical Resources</em></h3>
<p>Ensure the browser prioritizes the most important resources:</p>
<ul>
<li><p><strong>Preload key resources</strong>: Use the <code>&lt;link rel="preload"&gt;</code> tag for fonts, images, and other assets required early in the rendering process.</p>
</li>
<li><p><strong>Reduce the size of critical resources</strong>: Minify CSS, JavaScript, and compress images to decrease file sizes.</p>
</li>
</ul>
<h3 id="heading-5-reduce-the-number-of-critical-path-length"><em>5. Reduce the Number of Critical Path Length</em></h3>
<p>Shortening the CRP involves reducing the number of render-blocking requests:</p>
<ul>
<li><p><strong>Combine CSS and JavaScript files</strong>: Fewer requests translate to shorter load times.</p>
</li>
<li><p><strong>Eliminate render-blocking CSS and JavaScript</strong>: Defer or asynchronously load these files to allow the page to render sooner.</p>
</li>
</ul>
<h3 id="heading-6-optimize-web-fonts"><em>6. Optimize Web Fonts</em></h3>
<p>Fonts can delay the first paint and add to the CRP:</p>
<ul>
<li><p><strong>Use font-display: swap</strong>: This CSS property ensures text is displayed using fallback fonts until the web font is fully loaded.</p>
</li>
<li><p><strong>Preload fonts</strong>: Preload key font files to make them available earlier in the rendering process.</p>
</li>
</ul>
<h2 id="heading-measuring-and-monitoring-performance">Measuring and Monitoring Performance</h2>
<p>Optimization doesn’t end with implementation. Regularly measure performance using tools like Lighthouse or WebPageTest to analyze the CRP. Look for metrics such as:</p>
<ul>
<li><p><strong>First Contentful Paint (FCP)</strong></p>
</li>
<li><p><strong>Time to Interactive (TTI)</strong></p>
</li>
<li><p><strong>Largest Contentful Paint (LCP)</strong></p>
</li>
</ul>
<p>Identify bottlenecks and iteratively improve based on data.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>The <strong>Critical Render Path</strong> is a vital aspect of web performance. By understanding its components and employing optimization techniques, developers can create faster, more engaging websites. Remember, performance is a journey, not a destination. Continuously monitor, test, and refine your strategies to stay ahead in delivering exceptional user experiences. If you like this blog and want to learn more about software engineering and related topics then follow <strong>GDG Siliguri</strong> on <strong>hashnode</strong>.</p>
]]></content:encoded></item></channel></rss>