<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by nitesh kumar on Medium]]></title>
        <description><![CDATA[Stories by nitesh kumar on Medium]]></description>
        <link>https://medium.com/@nitesh14028?source=rss-e9550315cd74------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*e6oA_Be8oMvDnlkSRcgaYw.jpeg</url>
            <title>Stories by nitesh kumar on Medium</title>
            <link>https://medium.com/@nitesh14028?source=rss-e9550315cd74------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 23:22:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nitesh14028/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[React: Rendering → Compile + Runtime Engine]]></title>
            <link>https://medium.com/@nitesh14028/react-rendering-compile-runtime-engine-09e8e3966465?source=rss-e9550315cd74------2</link>
            <guid isPermaLink="false">https://medium.com/p/09e8e3966465</guid>
            <category><![CDATA[react-fiber]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[browser-rendering]]></category>
            <category><![CDATA[react-fiber-architecture]]></category>
            <category><![CDATA[javascript-compiler]]></category>
            <dc:creator><![CDATA[nitesh kumar]]></dc:creator>
            <pubDate>Sat, 30 May 2026 16:39:37 GMT</pubDate>
            <atom:updated>2026-05-30T16:53:52.848Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>React has evolved from a simple UI rendering library into a sophisticated engine that bridges the gap between developer productivity and machine performance. By shifting responsibilities from the developer to the compiler, and refining how the runtime handles updates, React is faster and more efficient than ever.</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sE70qh1gG2m2pDZr4iBbXw.png" /></figure><h3>1. Compile Time: Moving Optimization to the Machine</h3><p>Historically, React developers manually optimized performance using hooks like useMemo and useCallback. With the introduction of the <strong>React Compiler</strong>, the focus has shifted: we now let the toolchain handle memoization automatically.</p><ul><li><strong>Source Code &amp; JSX/Babel:</strong> Your code starts as standard JSX. The build process transforms this into structural descriptions of your UI.</li><li><strong>React Compiler:</strong> This is the heart of the “Compile Time” shift. It analyzes your code to understand component dependencies.</li><li><strong>Automated Optimization:</strong> Instead of forcing you to define dependency arrays, the compiler automatically injects memoization where needed.</li><li><strong>Goal:</strong> To guarantee <strong>stable references</strong> and <strong>purity</strong>, ensuring that components only re-render when their underlying data actually changes.</li></ul><blockquote>As a Result, The code becomes highly optimized for the runtime environment before it even reaches the browser.</blockquote><h3>2. Runtime: The Fiber Engine in Action</h3><p>Once the code is compiled, the React Runtime takes over to manage how the UI interacts with the user. This is governed by the <strong>Fiber Architecture</strong>, which allows React to break rendering work into small, interruptible units.</p><ul><li><strong>React Elements to Fiber:</strong> React converts elements into <strong>Fiber Nodes</strong>. These are lightweight, immutable objects that form a linked list, tracking the component tree’s parent, child, and sibling relationships.</li><li><strong>Reconciliation:</strong> This is the diffing process. React compares new Fiber nodes with old ones to identify the minimal set of changes required.</li><li><strong>Scheduler &amp; Lanes:</strong> This acts as a traffic controller. By assigning different “Lanes” (priorities) to tasks, React ensures the UI stays responsive:</li><li><strong>Highest Priority:</strong> User inputs (typing, clicks).</li><li><strong>Medium Priority:</strong> Component state updates.</li><li><strong>Lowest Priority:</strong> Background tasks (idle work).</li><li><strong>Render Phase:</strong> Unlike the old synchronous, blocking stack, the Render Phase is now <strong>asynchronous</strong>. React can pause, resume, or even discard rendering work, preventing the UI from freezing during expensive operations.</li><li><strong>Commit Phase:</strong> This is the final step where changes are applied to the actual DOM. Because this must be consistent, the Commit Phase is <strong>synchronous</strong> and cannot be interrupted, ensuring the user always sees a stable state.</li></ul><blockquote>React Fiber using own <strong>linked-list</strong> implementation combined with priority lanes over javascript execution stack, provides total contol over component rendering mechanism.</blockquote><blockquote>This transition from a simple recursive stack to a sophisticated Compiler + Asynchronous Runtime engine marks a massive leap forward in how we build high-performance web applications.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=09e8e3966465" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI-Assisted Development: My Experience Building with AI Copilots]]></title>
            <link>https://medium.com/@nitesh14028/ai-assisted-development-my-experience-building-with-ai-copilots-da62014db2bf?source=rss-e9550315cd74------2</link>
            <guid isPermaLink="false">https://medium.com/p/da62014db2bf</guid>
            <category><![CDATA[tech-career]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ai-developer-productivity]]></category>
            <dc:creator><![CDATA[nitesh kumar]]></dc:creator>
            <pubDate>Fri, 17 Apr 2026 18:38:35 GMT</pubDate>
            <atom:updated>2026-04-17T18:42:01.552Z</atom:updated>
            <content:encoded><![CDATA[<p>Over the past several months, AI copilots have transitioned from being experimental assistants to becoming integral parts of day-to-day software development. Their impact is not just in speeding up coding, but in reshaping how developers approach problem-solving, debugging, and system design.</p><p>This article summarises practical observations from using AI in real-world development workflows, highlighting where it excels, where it struggles, and how to use it effectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ea7XFmw9zziCgCNo" /><figcaption>Photo by <a href="https://unsplash.com/@hdbernd?utm_source=medium&amp;utm_medium=referral">Bernd 📷 Dittrich</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>1. Feature Development</h3><p><strong>Low to Medium Complexity</strong></p><p>For relatively straightforward features, AI copilots perform exceptionally well when provided with <strong>well-structured prompts and sufficient context</strong>.</p><ul><li>Requirements are interpreted accurately</li><li>Minimal iterations are needed</li><li>Generated code aligns reasonably well with existing patterns</li><li>Logic is often optimised out of the box</li></ul><p>In such cases, AI acts as a <strong>high-speed implementation layer</strong>, reducing development time significantly.</p><p><strong>Medium to High Complexity</strong></p><p>As complexity increases, a different strategy becomes necessary.</p><p>Instead of expecting end-to-end solutions, features must be:</p><ul><li>Broken into <strong>smaller, incremental stages</strong></li><li>Developed and validated step-by-step</li></ul><p>Each stage should be evaluated for:</p><ul><li>Functional correctness</li><li>Code quality and maintainability</li><li>Reusability of existing business logic</li></ul><p>Here, <strong>iterative refinement becomes critical</strong>. AI is most effective when guided through a structured development flow rather than being asked to solve everything at once.</p><h3>2. Debugging</h3><p>AI-assisted debugging shows mixed but promising results.</p><ul><li>In roughly <strong>50% of cases</strong>, copilots can identify the root cause when sufficient context is provided.</li><li>In about <strong>30% of cases</strong>, additional inputs are required:</li><li>Logs</li><li>Execution traces</li><li>Existing feature flows</li></ul><p>With iterative context enrichment, AI often converges on the correct diagnosis.</p><ul><li>In the remaining cases, <strong>manual investigation is still necessary</strong>, especially for:</li><li>Deep system-level issues</li><li>Complex edge cases</li><li>Race conditions or environment-specific bugs</li></ul><p>AI is best viewed as a <strong>debugging accelerator</strong>, not a replacement for engineering judgment.</p><h3>3. Testing</h3><p>One of the strongest areas for AI copilots is test generation.</p><p>When provided with:</p><ul><li>Clear requirements</li><li>Defined scope and boundaries</li><li>Explicit edge cases</li></ul><p>AI can generate <strong>near-complete test coverage (~100%)</strong>, including:</p><ul><li>Unit tests</li><li>Edge case validations</li><li>Basic integration scenarios</li></ul><p>This significantly reduces the effort required to maintain robust test suites and improves overall code reliability.</p><h3>4. AI in Day-to-Day Development</h3><p>A noticeable shift is the emergence of an <strong>AI-first development approach</strong>.</p><p>Developers increasingly rely on AI for:</p><ul><li>Understanding unfamiliar business logic</li><li>Debugging and defect analysis</li><li>Incremental feature development</li></ul><p>This has also led to a <strong>reduced dependency on traditional web searches</strong>, as AI can propose multiple solution strategies along with trade-offs.</p><h3>Effective Usage Patterns</h3><p>To get the most out of AI copilots:</p><ul><li>Actively guide them to:</li><li>Follow existing architectural patterns</li><li>Maintain code quality standards</li><li>Align with product workflows</li><li>Improve prompt quality by including:</li><li>Code snippets</li><li>Debugger logs / execution traces</li><li>Screenshots or even video recordings</li></ul><p>The richer the context, the better the output.</p><h3>Productivity Gains</h3><p>AI significantly reduces:</p><ul><li>Syntax errors</li><li>Boilerplate implementation effort</li><li>Common code-quality pitfalls</li></ul><p>This allows developers to focus more on <strong>architecture, design decisions, and edge cases</strong>.</p><h3>5. Limitations to Consider</h3><p>Despite the progress, there are clear constraints.</p><h3>Context Window Limitations</h3><p>AI copilots operate within a <strong>limited context window</strong>, which can lead to:</p><ul><li>Context drift</li><li>Loss of earlier assumptions</li><li>Inconsistent implementation decisions</li></ul><h3>Common Failure Patterns</h3><ul><li>Deviation from existing logic</li><li>Reduced reuse of established components</li><li>Inconsistencies with product workflows</li></ul><p>To mitigate this:</p><ul><li>Periodically <strong>reset and re-align context</strong></li><li>Reintroduce critical constraints and architectural decisions</li></ul><h3>6. Evolution Over the Last 6 Months</h3><p>One of the most noticeable improvements has been in <strong>multimodal understanding</strong>.</p><p>Compared to 6 months ago, now AI models are significantly better at:</p><ul><li>Interpreting screenshots</li><li>Understanding UI flows</li><li>Extracting context from videos</li><li>Even <strong>half-baked prompts</strong> now: Pick up intent more effectively</li><li>Infer missing context with higher accuracy</li></ul><p>This reduces the need for perfectly crafted prompts and lowers the barrier to effective usage.</p><h3>Final Summary: Real-World Impact Metrics</h3><p>Based on practical usage and broader industry trends, AI-assisted development is driving measurable improvements:</p><ul><li><strong>30–50% faster feature development</strong> for low to medium complexity tasks</li><li><strong>Up to 90–100% test coverage generation</strong> with proper input context</li><li><strong>50–70% reduction in debugging time</strong> for common issues</li><li><strong>Reduced reliance on search engines</strong> by replacing them with contextual AI assistance</li><li><strong>Improved developer focus</strong> on architecture over boilerplate</li></ul><h3>Closing Thought</h3><p>AI copilots are not replacing developers — they are <strong>reshaping how developers think and work</strong>.</p><blockquote>The key shift is this: From writing code → to <strong>guiding systems that generate code</strong></blockquote><blockquote>Developers who learn to structure problems, provide context effectively, and iteratively refine outputs will see the biggest gains from this transformation.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da62014db2bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fixing Japanese IME Input Lag in React: A Compositing Perspective]]></title>
            <link>https://medium.com/@nitesh14028/fixing-japanese-ime-input-lag-in-react-a-compositing-perspective-babf77cda8c7?source=rss-e9550315cd74------2</link>
            <guid isPermaLink="false">https://medium.com/p/babf77cda8c7</guid>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[compositing]]></category>
            <category><![CDATA[multilanguage-support]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[keyboard-input]]></category>
            <dc:creator><![CDATA[nitesh kumar]]></dc:creator>
            <pubDate>Thu, 16 Apr 2026 16:03:50 GMT</pubDate>
            <atom:updated>2026-04-16T16:06:04.694Z</atom:updated>
            <content:encoded><![CDATA[<p>Modern frontend systems often struggle with <strong>input stability during complex user interactions</strong>.</p><p>One such case is handling <strong>Japanese IME (Input Method Editor)</strong> in React applications — especially when combined with frequent state updates via Redux.</p><p>This is where <strong>compositing-aware thinking</strong> makes a real difference.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NhQM_LsN69DxixpU" /><figcaption>Photo by <a href="https://unsplash.com/@rupixen?utm_source=medium&amp;utm_medium=referral">rupixen</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>The Problem</h3><p>In a typical React setup:</p><ul><li>onChange triggers immediately on input</li><li>Redux updates global state</li><li>Component re-renders frequently</li></ul><p>This works fine for simple inputs — but breaks down with Japanese IME.</p><p><strong>Result:</strong></p><ul><li>Incorrect character input</li><li>Interrupted composition</li><li>Poor typing experience</li></ul><h3>Root Cause</h3><p>Japanese input doesn’t behave like simple keystrokes. It relies on a composition lifecycle:</p><ul><li>compositionstart</li><li>compositionupdate</li><li>compositionend</li></ul><p>During this phase:</p><blockquote><em>The browser is internally managing a temporary input buffer.</em></blockquote><p>Frequent re-renders (triggered by state updates) interfere with this process, leading to broken input behavior.</p><h3>The Fix</h3><h3>1. Control the Composition Lifecycle</h3><p>Prevent state updates during active composition:</p><pre>const [isComposing, setIsComposing] = useState(false);<br><br>&lt;input<br>  onCompositionStart={() =&gt; setIsComposing(true)}<br>  onCompositionEnd={(e) =&gt; {<br>    setIsComposing(false);<br>    handleChange(e);<br>  }}<br>  onChange={(e) =&gt; {<br>    if (!isComposing) {<br>      handleChange(e);<br>    }<br>  }}<br>/&gt;</pre><p>This ensures updates happen <strong>only after composition completes</strong>.</p><h3>2. Reduce Layout &amp; Paint Work</h3><p>During typing:</p><ul><li>Avoid DOM restructuring</li><li>Keep UI updates minimal</li><li>Prefer compositing-friendly styles (transform, opacity)</li></ul><blockquote>This reduces rendering pressure and keeps the browser stable.</blockquote><h3>3. Defer Expensive Updates</h3><p>Instead of updating state on every keystroke:</p><ul><li>Batch Redux updates</li><li>Use debouncing where appropriate</li></ul><blockquote>Prevents unnecessary re-renders during critical input phases.</blockquote><h3>Key Insight</h3><p><strong>Browsers need stability during input composition.</strong></p><p>Compositing helps by:</p><ul><li>Avoiding layout recalculation</li><li>Avoiding repaint cycles</li><li>Keeping updates lightweight and isolated</li></ul><h3>Closing Thought</h3><blockquote>This isn’t just about fixing IME issues.</blockquote><blockquote>It highlights a broader principle:</blockquote><blockquote>Not all UI updates should go through the full rendering pipeline.</blockquote><p>When you align your components with the browser’s <strong>compositing model</strong>, you get:</p><ul><li>Better input handling</li><li>Smoother interactions</li><li>More resilient UI systems</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=babf77cda8c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond Animations: Unlocking the Real Power of the Browser Compositing Phase]]></title>
            <link>https://medium.com/@nitesh14028/beyond-animations-unlocking-the-real-power-of-the-browser-compositing-phase-13b1410e2e45?source=rss-e9550315cd74------2</link>
            <guid isPermaLink="false">https://medium.com/p/13b1410e2e45</guid>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[web-performance]]></category>
            <category><![CDATA[browser-computing]]></category>
            <category><![CDATA[compositin]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <dc:creator><![CDATA[nitesh kumar]]></dc:creator>
            <pubDate>Thu, 16 Apr 2026 15:49:27 GMT</pubDate>
            <atom:updated>2026-04-16T15:56:14.821Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Compositing phase is far more powerful than smooth animations.</strong></p><blockquote>Most Engineers have heard this advice: “Use transform and opacity for animations.” <strong>True</strong> — but also incomplete.</blockquote><blockquote>It can fundamentally improve performance, input responsiveness, and system stability — especially in complex apps.</blockquote><p><strong>In this article, we’ll break down:</strong></p><ol><li>Advantages of compositing</li><li>What compositing actually is</li><li>Where it helps (beyond animations)</li><li>How to design UI components to take advantage of it</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VrgmSYgWgJUNqz7H" /><figcaption>Photo by <a href="https://unsplash.com/@redaquamedia?utm_source=medium&amp;utm_medium=referral">Denny Müller</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>Key Advantages of Compositing</strong></p><ol><li>GPU acceleration → smoother interactions and animations</li><li>Avoids layout &amp; paint → reduces expensive rendering work</li><li>Better input responsiveness → critical for typing, drag, and IME</li><li>Decouples UI from main thread → UI remains smooth during heavy JS execution</li><li>Improves perceived performance → instant visual feedback</li><li>Reduces repaint cost → reuses already rendered pixels</li><li>Isolates components → prevents cascading reflows/repaints</li><li>Optimizes for low-end devices → shifts work away from CPU</li></ol><p><strong>Key Areas Where Compositing Helps :- Before understanding the pipeline, it’s useful to know where compositing actually makes a difference in real systems.</strong></p><ol><li>Animations &amp; transitions :-<strong> </strong>Smooth, GPU-driven UI updates without layout recalculation</li><li>User input handling (typing, IME, forms) :-<strong> </strong>Prevents lag and interference with browser input systems</li><li>Scrolling &amp; sticky UI elements :-<strong> </strong>Enables jank-free scrolling experiences</li><li>Drag-and-drop interactions :-<strong> </strong>Keeps movement smooth without layout thrashing</li><li>Large visual elements (images, videos, canvases) :- Avoids repainting heavy pixels</li><li>Frequent state updates (React/Redux) :-<strong> </strong>Reduces UI blocking during rapid updates</li><li>Complex dashboards (charts, maps, widgets) :-<strong> </strong>Isolates expensive rendering areas</li><li>Concurrent rendering (React 18+) :- Maintains visual stability during interrupted renders</li><li>Low-end device optimization :-<strong> </strong>Offloads work to GPU for smoother performance</li></ol><p><strong>The Rendering Pipeline (Quick Refresher)</strong></p><p>Every UI update goes through:</p><ol><li>JavaScript execution</li><li>Style calculation</li><li>Layout (reflow)</li><li>Paint</li><li>Compositing</li></ol><blockquote>The key insight: <em>Not every change needs all steps.</em></blockquote><p><strong>Compositing phase</strong> is when the browser ?</p><ol><li><em>Takes already painted layers -&gt;</em></li><li><em>Moves, fades, or transforms them -&gt;</em></li><li><em>Without triggering layout or paint</em></li></ol><blockquote>It often runs on the <strong>GPU / compositor thread</strong>, not the main thread.</blockquote><p><strong>Why It Matters ? </strong>Update Type + Cost</p><ol><li>Layout + Paint -&gt; HIGH</li><li>Paint Only -&gt; MEDIUM</li><li>Composting Only -&gt; LOW</li></ol><blockquote>Push as many UI updates as possible into compositing.</blockquote><p><strong>Core Properties That Enable Compositing</strong></p><ul><li>transform</li><li>opacity</li><li>will-change (for layer promotion)</li></ul><pre>.card {<br>  transform: translateY(0);<br>  transition: transform 0.3s ease;<br>}</pre><p><strong>Where Compositing Helps (Beyond Animations)</strong></p><ol><li><strong>Decoupling UI from Main Thread Work.</strong></li></ol><p>Problem:- Heavy JS work (Redux updates, parsing, API handling) blocks UI. Solution:- Use compositing for visual feedback.</p><pre>setLoading(true); // visual (opacity/transform)<br>dispatch(expensiveAction()); // heavy work</pre><p><strong>Benefit</strong></p><ul><li>UI stays smooth even during CPU-heavy operations</li><li>Better responsiveness under load</li></ul><p><strong>2. Improving Perceived Performance :- </strong>Users care about <strong>feel</strong>, not metrics.</p><p><strong>Strategy</strong></p><ul><li>Show instant visual feedback (compositing)</li><li>Defer actual logic</li></ul><pre>setPressed(true);<br>requestIdleCallback(() =&gt; {<br>  dispatch(updateState());<br>});</pre><p><strong>Benefit</strong></p><ul><li>UI feels instant</li><li>Reduces perceived latency</li></ul><p><strong>3. Isolating Expensive Components</strong></p><p><strong>Problem:- </strong>One component causes full-page repaint.</p><p><strong>Solution:- </strong>Promote it to its own layer:</p><pre>.chart {<br>  will-change: transform;<br>}</pre><p><strong>Benefit</strong></p><ul><li>Prevents repaint cascade</li><li>Isolates performance issues</li></ul><p><strong>4. Handling Large Visual Elements Efficiently</strong></p><p><strong>Problem:- </strong>Moving images/videos triggers repaint.</p><p><strong>Solution:- </strong>Move using compositing</p><pre>transform: translateX(100px);</pre><p><strong>Benefit</strong></p><ul><li>No repaint of large pixels</li><li>Smooth movement of heavy assets</li></ul><p><strong>5. Scroll Performance Optimization</strong></p><p><strong>Problem:- </strong>Scroll + layout = jank</p><p><strong>Solution:- </strong>Use composited layers for sticky headers and floating elements</p><p><strong>Benefit</strong></p><ul><li>Smooth scrolling</li><li>No repaint on every scroll frame</li></ul><p><strong>6. Avoiding Repaint Storms</strong></p><p><strong>Problem:- </strong>Styles like shadows/gradients trigger expensive paints.</p><p><strong>Solution</strong></p><ul><li>Move elements into layers</li><li>Animate via compositing</li></ul><p><strong>Benefit</strong></p><ul><li>Reuse painted pixels</li><li>Avoid full repaint cycles</li></ul><p><strong>7. Handling Rapid State Changes</strong></p><p><strong>Scenarios</strong></p><ul><li>Typing</li><li>Sliders</li><li>Drag interactions</li></ul><p><strong>Strategy</strong></p><ul><li>Keep updates compositing-only</li><li>Defer structural updates</li></ul><p><strong>Benefit</strong></p><ul><li>Prevent input lag</li><li>Maintain high FPS</li></ul><p><strong>8. Smooth Drag-and-Drop Systems</strong></p><p><strong>Problem:- </strong>Dragging triggers layout repeatedly.</p><p><strong>Solution</strong></p><pre>transform: translate(x, y);</pre><p><strong>Benefit</strong></p><ul><li>60 FPS drag</li><li>No layout thrashing</li></ul><p><strong>9. Better Performance on Low-End Devices</strong></p><p><strong>Insight</strong></p><ul><li>CPU = bottleneck</li><li>GPU = underused</li></ul><p><strong>Benefit of compositing</strong></p><ul><li>Offloads work to GPU</li><li>Smoother UI on weaker devices</li></ul><p><strong>10. Stability with Concurrent Rendering (React 18+)</strong></p><p><strong>Problem :- </strong>Interrupted renders → flicker or inconsistency</p><p><strong>Solution</strong></p><ul><li>Keep visual updates compositing-based</li></ul><p><strong>Benefit</strong></p><ul><li>Stable UI during async rendering</li><li>Better UX with Suspense/Transitions</li></ul><p><strong>How to Design UI Components for Compositing</strong></p><p><strong>Prefer</strong></p><ul><li>transform → movement</li><li>opacity → visibility</li><li>isolated layers for dynamic elements</li></ul><p><strong>Avoid</strong></p><ul><li>top, left, width, height (layout triggers)</li><li>frequent DOM mutations</li><li>repaint-heavy styles in hot paths</li></ul><p><strong>Component Strategy Examples (Component + Strategy)</strong></p><p>Dropdown -&gt; opacity + transform</p><p>Tooltip -&gt; translate + fade</p><p>Carousel -&gt;translateX</p><p>Drag item -&gt; transform movement</p><p>Input field -&gt; minimal re-render</p><p>⚠<strong>When NOT to Overuse Compositing</strong></p><ul><li>Excessive will-change</li><li>Too many layers → memory overhead</li><li>Over-optimization without measurement</li></ul><p><strong>Final Takeaways</strong></p><ul><li>Compositing = <strong>fastest rendering path</strong></li><li>It’s not just for animations — it’s for:</li><li>responsiveness</li><li>stability</li><li>scalability</li></ul><blockquote>✍️Closing Thought</blockquote><blockquote>Most developers optimise React. But a frontend engineers optimise <strong>how the browser renders</strong>.</blockquote><blockquote><em>The real question isn’t “How do I update the UI?”</em></blockquote><blockquote><em>It’s: </em><strong><em>“Which part of the rendering pipeline am I triggering?”</em></strong></blockquote><ul><li>will-change (for layer promotion)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=13b1410e2e45" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WhatsApp’s End-to-End Encryption: Introduction]]></title>
            <link>https://medium.com/@nitesh14028/whatsapps-end-to-end-encryption-introduction-69a053b02182?source=rss-e9550315cd74------2</link>
            <guid isPermaLink="false">https://medium.com/p/69a053b02182</guid>
            <category><![CDATA[end-to-end-encryption]]></category>
            <category><![CDATA[whatsapp-encryption]]></category>
            <category><![CDATA[double-ratchet-algorithm]]></category>
            <category><![CDATA[signal-protocol]]></category>
            <category><![CDATA[curve25519]]></category>
            <dc:creator><![CDATA[nitesh kumar]]></dc:creator>
            <pubDate>Wed, 18 Feb 2026 09:50:48 GMT</pubDate>
            <atom:updated>2026-02-18T09:50:48.320Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Developer’s Journey Through the Most Secure Messaging System</h4><p>When you send “Hello!” on WhatsApp, it doesn’t just travel across the internet — it transforms into a cryptographic fortress.</p><p>Behind that simple message lies one of the most sophisticated encryption systems ever deployed at global scale. Even WhatsApp itself cannot read your messages. This isn’t marketing — it’s mathematics, engineering, and decades of cryptographic research working together.</p><p>WhatsApp applies end-to-end encryption to <strong>every message, call, photo, video, and document</strong> shared on its platform.</p><p>Let’s explore how.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FtIlXGUbsoRZ31qv" /><figcaption>Photo by <a href="https://unsplash.com/@markuswinkler?utm_source=medium&amp;utm_medium=referral">Markus Winkler</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>The Signal Protocol Foundation</h4><p>WhatsApp’s encryption system is built on the <strong>Signal Protocol</strong>, developed by cryptography experts at Open Whisper Systems.</p><ul><li><strong>Trusted by Major Platforms:</strong> Facebook Messenger (Secret Conversations), Google Messages, and Skype Private Conversations use this protocol.</li><li><strong>Security Professional’s Choice:</strong> When experts need secure communication, they rely on Signal Protocol–based systems.</li><li><strong>Perfect Forward Secrecy:</strong> Even if WhatsApp’s servers are compromised, your past conversations remain unreadable.</li><li><strong>Future Security (Post-Compromise Security):</strong> A compromised device today cannot decrypt your future messages due to continuous key regeneration.</li></ul><h4>Core Technologies Working Together</h4><p>WhatsApp’s security relies on several interconnected technologies working in harmony:</p><ul><li><strong>Elliptic Curve Cryptography (Curve25519):</strong> Mathematical foundation for secure key generation and exchange</li><li><strong>X3DH Key Agreement Protocol:</strong> Establishes secure channels even when recipients are offline</li><li><strong>Double Ratchet Algorithm:</strong> Continuously updates encryption keys for forward secrecy and compromise recovery</li><li><strong>AES-256 Encryption:</strong> Protects the actual message content</li><li><strong>HMAC-SHA256:</strong> Ensures message integrity and prevents tampering</li></ul><blockquote>These represent decades of cryptographic research from mathematicians, computer scientists, and security experts worldwide.</blockquote><h4>Why This Matters for Developers</h4><p>Understanding WhatsApp’s encryption system offers insights that extend far beyond messaging apps:</p><ul><li><strong>Privacy by Design:</strong> Build systems where user data stays private — even from the service provider</li><li><strong>Scalable Security:</strong> Implement enterprise-grade security for billions of users simultaneously</li><li><strong>Cryptographic Best Practices:</strong> Integrate multiple security primitives into cohesive systems</li><li><strong>Real-World Implementation:</strong> Bridge the gap between theoretical cryptography and production software</li></ul><blockquote>This is secure system design at planetary scale.</blockquote><h4>Our Complete Learning Roadmap</h4><p>We’ll explore WhatsApp’s end-to-end encryption in detail across multiple parts. Our roadmap includes:</p><ul><li><strong>Elliptic Curve Cryptography Foundation</strong> — Mathematical bedrock enabling efficient encryption</li><li><strong>X3DH Key Agreement Protocol</strong> — How two people establish secure channels without meeting</li><li><strong>Double Ratchet Algorithm</strong> — Forward secrecy and post-compromise security</li><li><strong>Cryptographic Primitives</strong> — AES, HMAC, and HKDF working together</li><li><strong>Device Registration &amp; Multi-Device Support</strong> — Managing security across devices</li><li><strong>Session Management &amp; Message Flow</strong> — Complete journey of a message from sender to recipient</li><li><strong>Group Messaging Architecture</strong> — Scaling end-to-end encryption to group conversations</li><li><strong>Security Verification Systems</strong> — How users verify encrypted channels</li><li><strong>Transport Security &amp; Network Protection</strong> — Securing connections between devices and WhatsApp servers</li><li><strong>Implementation Considerations</strong> — Real-world challenges and production trade-offs</li></ul><blockquote>Each article will include architecture diagrams, practical examples, and clear security explanations. We’ll explore historical context, design decisions, and technical trade-offs throughout.</blockquote><p>When Typed <strong>hello! </strong>in WhatsApp’s, Let’s see …</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dd9eKjLTSbOuSzFHzXSPJA.png" /></figure><h4>During Registration</h4><p>Each user generates:</p><ul><li><strong>Identity Key (IK)</strong>: Curve25519 long-term identity key (persists until app reinstallation)</li><li><strong>Signed Pre-key (SPK)</strong>: Curve25519 medium-term signed key (rotated weekly)</li><li><strong>One-Time Pre-key (OPK)</strong>: Batch of ~100 single-use Curve25519 keys</li><li><strong>Identity Key Loss</strong>: Lost/stolen device requires re-registration and key rotation</li><li><strong>TLS 1.3 (Transport Layer Security 1.3)</strong>: Provides secure HTTPS channel with perfect forward secrecy</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_F4MzFRY5vLnFxj2iPkknw.png" /></figure><p><strong>When Alex Sends “Hello!” to Bob</strong></p><ol><li><strong>Fetch Bob’s Signed Pre-key (SPK) and One-Time Pre-key (OPK)</strong>: The app requests Bob’s medium-term key proof (SPK) and a single-use key (OPK) from the server so messages can be encrypted uniquely for him.</li><li><strong>Ephemeral Key Generation (EK)</strong>: Alex’s phone creates a new temporary key (EK) for each message to keep sessions fresh and prevent old messages from being compromised.</li><li><strong>X3DH (Extended Triple Diffie-Hellman) &amp; Double Ratchet Init</strong>: These two protocols mix Alex’s and Bob’s keys to create a shared secret, then repeatedly update it to secure future messages.</li><li><strong>Message Key Derivation (MK)</strong>: A unique symmetric key (MK) is generated from the shared secret for encrypting just one message.</li><li><strong>Encrypt with AES-256-CBC and HMAC-SHA256</strong>: The message is ‘scrambled’ (AES-256-CBC) and given a ‘seal of authenticity’ (HMAC-SHA256) so it can’t be read or altered.</li><li><strong>OPK Exhaustion Handling</strong>: If Bob’s OPK pool is exhausted, Alex can still send messages but they will be queued on the server and delivered once Bob refreshes his OPKs.</li><li><strong>Server Validation and TLS 1.3</strong>: WhatsApp servers use secure HTTPS (TLS 1.3) and verify Bob’s key proofs, but never see the actual messages or private keys.</li></ol><blockquote><strong><em>Note</em></strong><em>: </em>When Bob’s One-Time Pre-keys (OPKs) are exhausted, Alex can still encrypt messages using Bob’s Signed Pre-key (SPK) and his Ephemeral Key (EK). The server stores these encrypted messages until Bob uploads new OPKs. The X3DH handshake then proceeds with SPK and EK to derive the shared secret.</blockquote><h4><strong>Global Impact of This Technology</strong></h4><p>Since enabling end-to-end encryption globally in April 2016, this technology has:</p><ul><li><strong>Protected Vulnerable Communities:</strong> Journalists and activists coordinate safely in restrictive environments</li><li><strong>Secured Healthcare Communication:</strong> Medical professionals share sensitive patient data confidentially</li><li><strong>Strengthened Business Security:</strong> Companies conduct negotiations with strong privacy guarantees</li><li><strong>Advanced Democratic Values:</strong> Over a billion people gained military-grade privacy protection</li></ul><blockquote>This is cryptography operating at global scale.</blockquote><h4>Final Thoughts</h4><p>WhatsApp’s encryption system is not just an algorithm.<br> It’s a layered architecture built on:</p><ul><li>Elliptic Curve Cryptography</li><li>X3DH key agreement</li><li>Double Ratchet key evolution</li><li>Strong symmetric encryption</li></ul><p>Ready to dive deeper into the mathematics and engineering behind the world’s most widely used encryption system?</p><blockquote><strong><em>Next Article:</em></strong><br>How WhatsApp’s End-to-End Encryption Actually Works — The Math Behind Curve25519 (Part 1)</blockquote><p>Let’s begin.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69a053b02182" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How WhatsApp’s End-to-End Encryption Actually Works — The Math Behind Curve25519 (Part 1)]]></title>
            <link>https://medium.com/@nitesh14028/how-whatsapps-end-to-end-encryption-actually-works-the-math-behind-curve25519-part-1-8ba0b82ae731?source=rss-e9550315cd74------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ba0b82ae731</guid>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[end-to-end-encryption]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[whatsapp]]></category>
            <dc:creator><![CDATA[nitesh kumar]]></dc:creator>
            <pubDate>Tue, 17 Feb 2026 10:01:46 GMT</pubDate>
            <atom:updated>2026-02-17T10:01:46.580Z</atom:updated>
            <content:encoded><![CDATA[<h4>When you tap <strong>“Send”</strong> on WhatsApp, your message begins a journey secured entirely by mathematics.</h4><p>Behind the scenes, WhatsApp’s <strong>end-to-end encryption (E2EE)</strong> relies on <strong>Elliptic Curve Cryptography (ECC)</strong> — specifically a curve called <strong>Curve25519</strong>.</p><p>This cryptographic design enables:</p><ul><li>Extremely fast key generation</li><li>Very small public keys</li><li>Strong resistance against modern cryptographic attacks</li></ul><p>But to understand why Curve25519 matters, we first need to understand what came before it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aI4K0xb8uTUdKsjj" /><figcaption>Photo by <a href="https://unsplash.com/@grafiklink?utm_source=medium&amp;utm_medium=referral">Hakim Menikh</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>1. Why Elliptic Curves?</h4><p>Traditional public-key cryptography, such as <strong>RSA</strong>, relies on the difficulty of integer factorisation.</p><p>RSA requires very large keys (2048+ bits) to remain secure. These large keys mean:</p><ul><li>Higher CPU usage</li><li>Larger network payloads</li><li>More battery consumption</li></ul><p>ECC, on the other hand, relies on the <strong>Elliptic Curve Discrete Logarithm Problem (ECDLP)</strong>.</p><p>It provides equivalent security using only <strong>256-bit keys</strong>.</p><p>For mobile messaging platforms serving billions of users, that efficiency difference is critical.</p><h4>How RSA Works (Simple and Practical View)</h4><p>The core idea behind RSA is simple:</p><blockquote><em>Multiplying two large prime numbers is easy.<br> Factoring their product is computationally infeasible.</em></blockquote><p>This one-way property creates public and private keys.</p><h4>RSA Key Generation Example (Simplified)</h4><p>Let’s use small numbers to understand the mechanics.</p><p>Choose two primes:</p><pre>p = 61  <br>q = 5</pre><p>Compute modulus:</p><pre>n = p × q = 3233</pre><p>Compute Euler’s Totient:</p><pre>ϕ(n) = (p − 1)(q − 1) = 3120</pre><p>Choose public exponent:</p><pre>e = 17</pre><p>Compute private key:</p><pre>d = 2753</pre><h4>Encryption &amp; Decryption</h4><p>Message:</p><pre>M = 123</pre><p>Encryption:</p><pre>C = (123^17) mod 3233 = 855</pre><p>Decryption:</p><pre>M = (855^2753) mod 3233 = 123</pre><p>In real systems:</p><ul><li>RSA-2048 public keys are ~256 bytes</li><li>Prime numbers are hundreds of digits long</li></ul><p>Example (truncated):</p><pre>n = 9e1fd89da2e5… (hundreds of hex digits)<br>e = 0x010001</pre><p>Factoring such numbers is practically impossible with current computing power.</p><h4>RSA vs ECC — The Size Difference</h4><p>RSA-2048 Algo uses <strong>256 bytes</strong> key-size .</p><p>Curve2551932 Algo uses <strong>32 bytes</strong> key-size .</p><blockquote><em>Both provide same level of security. Same security class. </em><strong><em>8× smaller keys.</em></strong></blockquote><blockquote><em>That is why modern secure messaging systems moved toward ECC.</em></blockquote><blockquote><strong>Cons:</strong> Complexity of Curve2551932 increase with multi-stage security handling compared to RSA</blockquote><h4><strong>2. Curve25519 — The Mathematical Foundation</strong></h4><p>Curve25519 is defined by the equation:</p><pre>y² = x³ + 486662x² + x  (mod 2²⁵⁵ − 19)</pre><p>Instead of factoring large numbers, its security relies on the difficulty of solving:</p><blockquote><em>Given A = a × G, find “a”.</em></blockquote><p>This is the <strong>Elliptic Curve Discrete Logarithm Problem</strong>.</p><p>Forward operation → easy.<br>Reverse operation → infeasible.</p><h4>Key Properties of Curve25519</h4><p>Prime Field</p><pre>p = 2²⁵⁵ − 19</pre><p>Chosen for fast modular arithmetic.</p><h4>Montgomery Form</h4><p>Enables efficient scalar multiplication using only x-coordinates.</p><h4>Strong Security Margin</h4><p>Widely used in:</p><ul><li>Signal</li><li>TLS</li><li>SSH</li><li>WhatsApp</li></ul><h4>3. Key Pair Generation</h4><p>Private Key a:<br>Random 32-byte integer.</p><p>Public Key A:</p><pre>A = a × G</pre><p>Where G is a fixed base point on the curve.</p><h4>Clamping</h4><p>Certain bits of the private key are forced to specific values to:</p><ul><li>Avoid weak keys</li><li>Prevent small-subgroup attacks</li><li>Improve implementation safety</li></ul><h4>4. Diffie–Hellman on Curve25519</h4><p>Alice computes:</p><pre>A = a × G</pre><p>Bob computes:</p><pre>B = b × G</pre><p>Shared Secret:</p><pre>S = a × B = b × A</pre><p>Both derive the same 32-byte secret without sharing private keys.</p><p>This secret becomes the foundation for higher-level protocols.</p><h4>5. From Math to WhatsApp Messages</h4><p>During registration, each WhatsApp user generates:</p><ul><li>Identity Key (IK)</li><li>Signed PreKey (SPK)</li><li>One-Time PreKeys (OPK)</li></ul><p>All based on Curve25519.</p><p>When two users start a conversation:</p><ol><li>X3DH performs asynchronous key agreement.</li><li>A shared secret is derived.</li><li>That secret feeds into the Double Ratchet algorithm.</li><li>Every message gets a fresh encryption key.</li></ol><h4>Security Guarantees</h4><p>Perfect Forward Secrecy: Compromise of long-term keys does not expose past messages.</p><p>Post-Compromise Security: Even if a device is breached, future messages become secure once the ratchet advances.</p><h4>Final Thoughts</h4><p>WhatsApp’s end-to-end encryption is not a single algorithm.</p><p>It is a layered system built on:</p><ul><li>Curve25519</li><li>X3DH</li><li>Double Ratchet</li></ul><p>Small keys.<br>Hard math.<br>Strong guarantees.</p><p>And it all begins with an elliptic curve.</p><h4>Part 2 — Structure Optimised for Virality</h4><p>How WhatsApp Enables Secure Messaging Even When You’re Offline — Inside the X3DH Protocol (Part 2)</p><p>Structure:</p><ol><li>The Offline Messaging Problem</li><li>Why Normal Diffie-Hellman Fails Asynchronously</li><li>Introduction to Prekeys</li><li>Step-by-Step X3DH Walkthrough</li><li>Diagram of Key Combinations</li><li>How Replay Attacks Are Prevented</li><li>Why It Enables Secure First Messages</li><li>Transition to Double Ratchet (Part 3 Hook)</li></ol><blockquote><em>In Part 3, we’ll explore how the Double Ratchet ensures that every single message has a brand-new encryption key.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ba0b82ae731" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Atlassian Interview Experience (OCT-25 to Feb-26)]]></title>
            <link>https://medium.com/@nitesh14028/atlassian-interview-experience-oct-25-to-feb-26-cd0c75481739?source=rss-e9550315cd74------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd0c75481739</guid>
            <category><![CDATA[sofware-engineering]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[frontend-interviews]]></category>
            <category><![CDATA[interview-experience]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <dc:creator><![CDATA[nitesh kumar]]></dc:creator>
            <pubDate>Tue, 17 Feb 2026 08:55:22 GMT</pubDate>
            <atom:updated>2026-02-17T08:55:22.027Z</atom:updated>
            <content:encoded><![CDATA[<h4>Senior Frontend Heavy Full-Stack Engineer — P50.</h4><p>Over the past few months, I went through a complete interview loop for a frontend-heavy full-stack role. While the role was eventually paused, the process reinforced something I strongly believe:</p><blockquote><em>Strong frontend engineers must think in distributed systems. </em>Here’s how I approach building and designing modern web systems.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CO_e5FDcXnSWvJUYU9zWZw.png" /></figure><h3>Initial Technical Screening — Karat:</h3><p>One of the discussions revolved around explaining what happens when a user clicks a “checkout” or “pay” button.</p><p>A single click travels far beyond the browser — through the CDN, API gateway, authentication layer, payment provider, and multiple backend services.</p><h4>To structure my explanation, I broke it down into three layers:</h4><p>Frontend Layer :</p><ul><li>DOM event lifecycle</li><li>Input validation before network call</li><li>Idempotency protection</li><li>CSRF token handling</li><li>CORS enforcement</li><li>Third-party iframe isolation</li><li>Graceful failure states (retry / pending / timeout)</li></ul><p>Network Layer :</p><ul><li>HTTP/2 vs HTTP/3 trade-offs</li><li>HSTS enforcement</li><li>Mitigating MITM attacks</li><li>Handling packet loss and retransmission</li></ul><p>Backend Layer :</p><ul><li>Middleware validation</li><li>Server-side price re-verification</li><li>Inventory locking strategy</li><li>Ledger-style transaction storage</li><li>Event-driven confirmation via webhooks</li><li>Compliance awareness (GDPR, regional regulations)</li></ul><p>The key principle:</p><blockquote><em>Never trust the client. Always validate at the boundary.</em></blockquote><h3>Frontend Architecture Discussion — Browser Coding</h3><p>In the browser coding discussion, the focus wasn’t just on implementing a component — it was on designing reusable frontend infrastructure.</p><p>When designing a dynamic tab management system. I approached it as:</p><ul><li>A design-system-level primitive</li><li>Routing-aware</li><li>Configurable rendering strategy</li><li>Decoupled data-fetching responsibility</li><li>Performance optimisation through memoization</li><li>Failure-resilient with loading fallbacks</li></ul><p>Design Trade-offs Considered :</p><ul><li>Should the tab component own data fetching? Or should it remain presentation-only?</li><li>How do we support both without violating separation of concerns?</li><li>How do we prevent unnecessary re-renders?</li><li>How do we maintain URL-driven state consistency?</li></ul><blockquote>The difference between junior and senior frontend engineering is not JSX complexity — it’s <strong>state architecture and ownership clarity</strong>.</blockquote><h3>Deep Technical Discussion — Full-Stack Craft</h3><p>When explaining authorisation in depth, I break it into 3 layers:</p><p><strong>Network :</strong></p><ul><li>Secure transport (TLS)</li><li>Certificate validation</li><li>HSTS enforcement</li><li>DNS lookup &amp; caching</li><li>TLS handshake</li><li>Packet acknowledgment</li></ul><p><strong>Frontend :</strong></p><ul><li>Secure credential submission</li><li>CSRF anti-forgery tokens</li><li>Token storage trade-offs (memory vs cookie vs localStorage)</li><li>Sub-resource integrity for third-party scripts</li></ul><p><strong>Backend :</strong></p><ul><li>Password hashing (never plain storage)</li><li>JWT signature validation</li><li>Refresh token lifecycle</li><li>Middleware-based user context injection</li><li>Distributed token verification strategy</li><li>Revocation strategy (blacklisting vs short expiry)</li></ul><blockquote>The core concept: <em>Authentication proves identity. Authorisation enforces capability.</em></blockquote><h3>System Design: Real-Time Chat Architecture</h3><p>When thinking about designing a chat system, I approach it in structured layers.</p><h4>Step 1: Requirement Classification</h4><p>Functional :</p><ul><li>Send/receive messages</li><li>Delivery &amp; read receipts</li><li>Online presence</li><li>Message history</li></ul><p>Non-functional :</p><ul><li>Low latency</li><li>High availability</li><li>Horizontal scalability</li><li>Offline resilience</li><li>Backward compatibility</li></ul><h4>Step 2: Real-Time Communication Strategy</h4><p>Evaluate: Short polling vs Long polling vs Server-Sent Events (SSE) vs WebSockets</p><p>For bi-directional real-time communication, WebSockets are often optimal.</p><p>But trade-offs include:</p><ul><li>Load balancer sticky sessions</li><li>Horizontal scaling complexity</li><li>Connection lifecycle management</li></ul><h4>Step 3: Client Architecture</h4><p>I outlined a high-level component design to support:</p><ul><li>Unique client-generated message IDs</li><li>Optimistic UI updates</li><li>Design System for independent component development and multi-platform support</li><li>Retry mechanism with exponential backoff</li><li>IndexedDB for offline persistence</li><li>Reconciliation strategy when connection restores</li></ul><h4>Step 4: Backend Considerations (High-Level)</h4><p>Even in frontend-focused design, backend awareness matters:</p><ul><li>Message storage partitioning strategy</li><li>Ordering guarantees</li><li>Event-driven architecture</li><li>Idempotent message processing</li><li>Read receipt propagation</li></ul><h4>Step 5: API Design Philosophy</h4><p>When designing APIs, I follow principles:</p><ul><li>Backward compatibility first</li><li>Versioning strategy</li><li>Clear request/response schema and proper HTTP status usage</li><li>Idempotent operations where applicable</li><li>Pagination and filtering standards</li></ul><h4>Step 6: Performance Thinking</h4><p>Frontend performance is system design:</p><ul><li>Code splitting (Webpack5 &amp; beyond)</li><li>Lazy loading</li><li>Memoization</li><li>Virtualisation for large lists</li><li>Avoiding unnecessary reflows</li></ul><blockquote>I explicitly called out where I would start simple and evolve the system as scale increased, rather than over-engineering from day one.</blockquote><h3>Managerial &amp; Values Discussion: Engineering Maturity Beyond Code</h3><p>The final stage focused less on code and more on decision-making maturity.</p><p>At senior levels, the expectation shifts from: <em>“Can you build it?” </em>to <em>“Can you lead clarity under ambiguity?”</em></p><p>Here’s how I approach those discussions.</p><ul><li>Ownership Under Ambiguity, As in fast-moving environments, requirements are rarely complete.</li><li>I focus on clarifying goals early, identifying constraints, communicating trade-offs transparently, and documenting decisions so future teams understand the context.</li></ul><blockquote>Ambiguity is not a blocker — it’s an opportunity to lead.</blockquote><h3>Final Reflection</h3><p>Technical depth opens doors. Structured thinking and collaborative maturity create lasting impact.</p><blockquote><em>High-performing engineering teams value structured thinking, strong fundamentals, and humility in execution.</em></blockquote><blockquote><em>I strongly believe engineers should participate in system design discussions early, not just consume APIs.</em></blockquote><p>While the role was paused due to evolving organisational priorities, the overall experience was highly enriching.</p><p>If you’re building products that require both deep technical architecture and collaborative engineering culture — <strong><em>I’d love to connect.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd0c75481739" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Overrode Salesforce Lightning Datatable Styles Without Wrappers or Hacks]]></title>
            <link>https://medium.com/@nitesh14028/how-i-overrode-salesforce-lightning-datatable-styles-without-wrappers-or-hacks-ce709f7466db?source=rss-e9550315cd74------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce709f7466db</guid>
            <category><![CDATA[overriding]]></category>
            <category><![CDATA[salesforce-development]]></category>
            <category><![CDATA[lightning-datatable]]></category>
            <category><![CDATA[lwc-development]]></category>
            <category><![CDATA[staticresource]]></category>
            <dc:creator><![CDATA[nitesh kumar]]></dc:creator>
            <pubDate>Wed, 25 Jun 2025 18:32:52 GMT</pubDate>
            <atom:updated>2026-04-16T16:07:26.337Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever struggled with styling lightning-datatable in LWC?</p><p>Most of us know that Shadow DOM and Locker Service lock down styling for base components. But while working with a <strong>custom datatable extended from </strong><strong>lightning/datatable</strong>, I discovered a clean, scalable way to override even internal styles <strong>without hacks or wrappers</strong> — by using a <strong>CSS static resource</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-i_a6QH3v-3HrQVX" /><figcaption>Photo by <a href="https://unsplash.com/@little_a?utm_source=medium&amp;utm_medium=referral">Anthony</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>Here’s how it works:</blockquote><ol><li><strong>Create a static CSS resource</strong> (datatableOverrides.css)</li></ol><pre>[data-col-key-value*=&quot;-rowNumber-&quot;] {<br>  background-color: #fffae6 !important;<br>  font-weight: bold;<br>}</pre><p>2. Load it inside your LWC</p><pre>import { loadStyle } from &#39;lightning/platformResourceLoader&#39;;<br>import DATATABLE_CSS from &#39;@salesforce/resourceUrl/datatableOverrides&#39;;<br><br>connectedCallback() {<br>  loadStyle(this, DATATABLE_CSS);<br>}</pre><p>3. <strong>Style takes effect — globally</strong>, even inside the datatable’s shadow DOM-like structure.</p><blockquote>Why this works:</blockquote><p>When you extend lightning/datatable, Salesforce doesn&#39;t encapsulate everything. The injected static resource CSS gets loaded globally into the page and <strong>can reach internal table cells via attributes like </strong><strong>data-col-key-value</strong>.</p><p>No renderedCallback. No JavaScript DOM selectors. No wrappers. Just clean CSS.</p><h4>What You Can Style</h4><ul><li>Row numbers</li><li>Edited cells</li><li>Custom columns</li><li>others standard component</li></ul><h4>Real Use Case</h4><p>We used this to highlight edited rows and custom checkbox columns — without polluting the logic with JS or adding complex component wrappers.</p><h4>Limitations:</h4><ul><li>Doesn’t apply to all base components (lightning-button, etc.)</li><li>May be blocked under strict Locker Service</li><li>Only tested with extended datatables, not standard &lt;lightning-datatable&gt;</li></ul><p>If you’re building enterprise-quality LWC data-tables and want control, this method is lightweight, reusable, and dev-friendly.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce709f7466db" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a Kanban Board with Horizontal Scrolling Using LWC]]></title>
            <link>https://medium.com/@nitesh14028/kanban-board-with-horizontal-scrolling-0743226b0fa5?source=rss-e9550315cd74------2</link>
            <guid isPermaLink="false">https://medium.com/p/0743226b0fa5</guid>
            <category><![CDATA[kanban-board-lwc]]></category>
            <category><![CDATA[simple-and-easy]]></category>
            <category><![CDATA[horizontal-scrolling]]></category>
            <category><![CDATA[kanban-board]]></category>
            <dc:creator><![CDATA[nitesh kumar]]></dc:creator>
            <pubDate>Mon, 05 May 2025 15:13:27 GMT</pubDate>
            <atom:updated>2025-05-06T05:12:01.382Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FqID_lpt0w90%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DqID_lpt0w90&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FqID_lpt0w90%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c347462770a43c0c345c9715bd1b212/href">https://medium.com/media/3c347462770a43c0c345c9715bd1b212/href</a></iframe><p>Key points to remember:-</p><ul><li>Segregate Code base and design as modular component.</li><li>Prefer simple and efficient HTML &amp; CSS for great UX Design</li><li>Understand drag and drop browser events and it’s working.</li><li>check out: <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API">developer mozilla docs</a></li></ul><p>Source Code written is simple easy to understand. Please feel free to update as required.</p><p>It’s written in LWC but can easily modified for React, Angular, Vue, etc.</p><h4>Kanban.js</h4><pre>import { LightningElement, track } from &#39;lwc&#39;;<br><br>const stages = [<br>    {   id: 1,<br>        label: &#39;To Do&#39;,<br>        items: [<br>            {<br>                id: 1,<br>                label: &#39;Ticket 1&#39;,<br>                description: &#39;This task is used for trasportation&#39;,<br>            },<br>            {<br>                id: 2,<br>                label: &#39;Ticket 2&#39;,<br>                description: &#39;This task is used for service&#39;,<br>            },<br>        ]<br>    },<br>    {<br>        id: 2,<br>        label: &#39;In Progress&#39;,<br>        items: [<br>            {<br>                id: 3,<br>                label: &#39;Ticket 3&#39;,<br>                description: &#39;This task is used for logistics&#39;,<br>            },<br>        ]<br>    },<br>    {<br>        id: 3,<br>        label: &#39;In Review&#39;,<br>        items: [<br>            {<br>                id: 4,<br>                label: &#39;Ticket 4&#39;,<br>                description: &#39;This task is used for management&#39;,<br>            }<br>        ]<br>    },<br>    {   id: 4,<br>        label: &#39;Ready for Testing&#39;,<br>        items: [<br>            {<br>                id: 5,<br>                label: &#39;Ticket 5&#39;,<br>                description: &#39;This task is used for engineering&#39;,<br>            }<br>        ]<br>    },<br>    {   id: 5,<br>        label: &#39;Testing&#39;,<br>        items: [<br>            {<br>                id: 6,<br>                label: &#39;Ticket 6&#39;,<br>                description: &#39;This task is used for trasportation&#39;,<br>            },<br>            {<br>                id: 7,<br>                label: &#39;Ticket 7&#39;,<br>                description: &#39;This task is used for service&#39;,<br>            }<br>        ]<br>    },<br>    {<br>        id: 6,<br>        label: &#39;Verified&#39;,<br>        items: [<br>            {<br>                id: 8,<br>                label: &#39;Ticket 8&#39;,<br>                description: &#39;This task is used for logistics&#39;,<br>            },<br>        ]<br>    },<br>    {<br>        id: 7,<br>        label: &#39;Completed&#39;,<br>        items: [<br>            {<br>                id: 9,<br>                label: &#39;Ticket 9&#39;,<br>                description: &#39;This task is used for management&#39;,<br>            },<br>            {<br>                id: 10,<br>                label: &#39;Ticket 10&#39;,<br>                description: &#39;This task is used for engineering&#39;,<br>            }<br>        ]<br>    },<br>];<br><br>export default class DrapAndDrop extends LightningElement {<br>    stages = stages;<br>    draggingItemId;<br>    dragCounter = 0;<br>    @track getScrollContentStyle;<br><br>    renderedCallback() {<br>        const wrapperRect =  this.template.querySelector(&#39;.wrapper&#39;)?.getBoundingClientRect();<br>        if (wrapperRect) {<br>            const { top, bottom } = wrapperRect;<br>            const setScrollContentHeight = Math.abs(top - Math.min(bottom, window.innerHeight));<br>            this.getScrollContentStyle = `height: ${setScrollContentHeight}px`;<br>        }<br>        <br>    }<br><br>    itemDragStart(event) {<br>        const itemId = event.target.dataset.id || null;<br>        this.draggingItemId = itemId;<br>    }<br><br>    itemDrop(event) {<br>        let stageId = event.target.closest(&#39;.stage-container&#39;)?.dataset.stageId;<br>        if (stageId &amp;&amp; this.draggingItemId) {<br>            let foundItem;<br>            this.draggingItemId = parseInt(this.draggingItemId, 10);<br>            stageId = parseInt(stageId, 10);<br><br>            this.stages.some((stage) =&gt; stage.items.some(item =&gt; {<br>                if (item.id === this.draggingItemId) {<br>                    foundItem =  { ...item};<br>                    return true;<br>                }<br>                return false<br>            }))<br><br>            this.stages = this.stages.map(stage =&gt; {<br>                const { id: _stageId, items = []} = stage;<br>                const ret =  {<br>                    ...stage,<br>                    items: items.filter(({id}) =&gt; id !== this.draggingItemId),<br>                }<br><br>                if (_stageId === stageId) {<br>                    ret.items.push({...foundItem});<br>                }<br>                return ret;<br>            });<br>        }<br>        this.draggingItemId = null;<br>    }<br><br>    itemDragOver(e) {<br>        e.preventDefault();<br>    }<br><br>    onWrapperDragStart() {<br>        const wrapperEl = this.template.querySelector(&#39;.wrapper&#39;);<br>        const scrollBarEl = this.template.querySelectorAll(&#39;.scroll-bar&#39;);<br>        wrapperEl.classList.add(&#39;dragging&#39;);<br>        scrollBarEl.forEach(el =&gt; el.classList.add(&#39;visible&#39;));<br>    }<br><br>    onWrapperDragEnd() {<br>        const wrapperEl = this.template.querySelector(&#39;.wrapper&#39;);<br>        const scrollBarEl = this.template.querySelectorAll(&#39;.scroll-bar&#39;);<br>        wrapperEl.classList.remove(&#39;dragging&#39;);<br>        scrollBarEl.forEach(el =&gt; el.classList.remove(&#39;visible&#39;));<br>        this.dragCounter = 0;<br>    }<br><br>    onWrapperDragLeave() {<br>        this.dragCounter--;<br>        if(this.dragCounter === 0) {<br>            this.onWrapperDragEnd();<br>        }<br>    }<br><br>    onWrapperDragEnter() {<br>        if (this.dragCounter === 0) {<br>            this.onWrapperDragStart();<br>        }<br>        this.dragCounter++; <br>    }<br><br>    showScrollBarStyles(activeScroll) {<br>        if (activeScroll === &#39;left&#39;) {<br>            const scrollLeftEl = this.template.querySelector(&#39;.scroll-left&#39;);<br>            scrollLeftEl.classList.add(&#39;active&#39;);<br>        } else if (activeScroll === &#39;right&#39;) {<br>            const scrollLeftEl = this.template.querySelector(&#39;.scroll-right&#39;);<br>            scrollLeftEl.classList.add(&#39;active&#39;);<br>        }<br>    }<br><br>    hideScrollBarStyles() {<br>        // eslint-disable-next-line @lwc/lwc/no-async-operation<br>        setTimeout(() =&gt; {<br>            if(this.scrollInterval) return;<br>            const scrollBarEl = this.template.querySelectorAll(&#39;.scroll-bar&#39;);<br>            scrollBarEl.forEach(el =&gt; el.classList.remove(&#39;active&#39;));<br>        }, 100);<br>    }<br><br>    scrollRightStart() {<br>        // eslint-disable-next-line @lwc/lwc/no-async-operation<br>        setTimeout(() =&gt; {<br>            if(this.scrollInterval) return;<br>            const stageEl = this.template.querySelector(&#39;.stage-wrapper&#39;);<br>            const { clientWidth, scrollWidth } = stageEl;<br>            const scrollfps = 11;<br>            const scrollOffset = 5;<br><br>            // eslint-disable-next-line @lwc/lwc/no-async-operation<br>            this.scrollInterval = setInterval(() =&gt; {<br>                const newScrollPosition = stageEl.scrollLeft + scrollOffset;<br>                if (newScrollPosition + clientWidth &gt;= scrollWidth) {<br>                    stageEl.scrollLeft = clientWidth + Math.abs(scrollWidth - clientWidth);<br>                    this.scrollEnd();<br>                } else {<br>                    stageEl.scrollLeft = newScrollPosition;<br>                    this.showScrollBarStyles(&#39;right&#39;);<br>                }<br>            }, scrollfps);<br>        }, 0)<br>    }<br><br>    scrollLeftStart() {<br>         // eslint-disable-next-line @lwc/lwc/no-async-operation<br>        setTimeout(() =&gt; {<br>            if(this.scrollInterval) return;<br>            const stageEl = this.template.querySelector(&#39;.stage-wrapper&#39;);<br>            const scrollfps = 11;<br>            const scrollOffset = 5;<br>            // eslint-disable-next-line @lwc/lwc/no-async-operation<br>            this.scrollInterval = setInterval(() =&gt; {<br>                const newScrollPosition = stageEl.scrollLeft - scrollOffset;<br>                if (newScrollPosition&lt;= 0) {<br>                    stageEl.scrollLeft = 0;<br>                    this.scrollEnd();<br>                } else {<br>                    stageEl.scrollLeft = newScrollPosition;<br>                    this.showScrollBarStyles(&#39;left&#39;);<br>                }<br>            }, scrollfps);<br>        }, 0)<br>    }<br><br>    scrollEnd() {<br>        clearInterval(this.scrollInterval);<br>        this.scrollInterval = null;<br>        this.hideScrollBarStyles();<br>    }<br><br>}</pre><h4>Kanban.html</h4><pre>&lt;template&gt;<br>    &lt;div class=&quot;drag-drop-container&quot;&gt;<br>        &lt;div class=&quot;wrapper&quot; ondragenter={onWrapperDragEnter} ondrop={onWrapperDragEnd} ondragleave={onWrapperDragLeave}&gt;<br>            &lt;!-- onDragEnter and onDragLeave --&gt;<br>            &lt;div class=&quot;scroll-bar scroll-left&quot; data-scroll-to=&quot;left&quot; ondragenter={scrollLeftStart} ondragleave={scrollEnd}&gt;<br>                &lt;div class=&quot;scroll-bar-content&quot; style={getScrollContentStyle} ondragenter={scrollLeftStart} ondragleave={scrollEnd}&gt;<br>                    &lt;lightning-icon icon-name=&quot;utility:jump_to_left&quot;&gt;&lt;/lightning-icon&gt;<br>                    &lt;span class=&quot;scroll-text&quot;&gt;Left&lt;/span&gt;<br>                &lt;/div&gt;<br>            &lt;/div&gt;<br>            &lt;div class=&quot;stage-wrapper&quot;&gt;<br>                &lt;template for:each={stages} for:item=&quot;stage&quot;&gt;<br>                    &lt;div class=&quot;stage-container&quot; key={stage.id} ondrop={itemDrop} data-stage-id={stage.id} ondragover={itemDragOver}&gt;<br>                        &lt;div class=&quot;stage-header&quot;&gt;<br>                            &lt;div class=&quot;stage-header-title&quot;&gt;{stage.label}&lt;/div&gt;<br>                        &lt;/div&gt;<br>                        &lt;div class=&quot;card-wrapper&quot;&gt;<br>                            &lt;template for:each={stage.items} for:item=&quot;item&quot;&gt;<br>                                &lt;div class=&quot;card-container&quot; key={item.id} data-id={item.id} draggable=&quot;true&quot; ondragstart={itemDragStart}&gt;<br>                                    &lt;div class=&quot;card-title&quot;&gt;<br>                                        &lt;div class=&quot;&quot;&gt;{item.label}&lt;/div&gt;<br>                                    &lt;/div&gt;<br>                                    &lt;div class=&quot;card-description&quot;&gt;<br>                                        &lt;div class=&quot;&quot;&gt;{item.description}&lt;/div&gt;<br>                                    &lt;/div&gt;<br>                                &lt;/div&gt;<br>                            &lt;/template&gt;<br>                        &lt;/div&gt;<br>                    &lt;/div&gt;<br>                &lt;/template&gt;<br>            &lt;/div&gt;<br>            &lt;!-- onDragEnter and onDragLeave --&gt;<br>            &lt;div class=&quot;scroll-bar scroll-right&quot; data-scroll-to=&quot;right&quot; ondragenter={scrollRightStart} ondragleave={scrollEnd}&gt;<br>                &lt;div class=&quot;scroll-bar-content&quot; style={getScrollContentStyle} ondragenter={scrollRightStart} ondragleave={scrollEnd}&gt;<br>                    &lt;lightning-icon icon-name=&quot;utility:jump_to_right&quot;&gt;&lt;/lightning-icon&gt;<br>                    &lt;span class=&quot;scroll-text&quot;&gt;Right&lt;/span&gt;<br>                &lt;/div&gt;<br>            &lt;/div&gt;<br>        &lt;/div&gt;<br>    &lt;/div&gt;<br>&lt;/template&gt;</pre><h4>Kanban.css</h4><pre>.wrapper {<br>    display: flex;<br>    width: 100%;<br>    overflow: hidden;<br>    position: relative;<br>    border-radius: 4px;<br>}<br><br>.stage-wrapper {<br>    display: flex;<br>    width: 100%;<br>    justify-content: space-between;<br>    background-color: #F3F3F3;<br>    gap: 20px;<br>    overflow: auto;<br>    scrollbar-gutter: stable;<br>    padding-bottom: 20px;<br>}<br><br>.drag-drop-container {<br>    padding: 20px;<br>    background-color: #F3F3F3;<br>}<br><br>.dragging {<br>    opacity: 0.8;<br>}<br><br>.stage-container {<br>    border: 1px solid #0B5CAB;<br>    border-radius: 4px;<br>    flex: 1 0 300px;<br>    overflow: hidden;<br>}<br><br>.stage-header {<br>    text-align: center;<br>    font-size: 1.2rem;<br>    background: #032D60;<br>    color: #fff;<br>    padding: 5px;<br>    font-weight: 600;<br>}<br><br>.card-wrapper {<br>    margin: 10px;<br>    display: flex;<br>    flex-direction: column;<br>    gap: 20px;<br>}<br><br>.card-container {<br>    border: 1px solid #0B5CAB;<br>    overflow: hidden;<br>    border-radius: 4px;<br>    border: 1px solid;<br>    border-radius: 4px;<br>    display: flex;<br>    flex-direction: column;<br>}<br><br>.card-title {<br>    font-size: 1rem;<br>    background: #CFE9FE;<br>    padding: 5px;<br>    font-weight: 500;<br>}<br><br>.card-description {<br>    font-size: .8rem;<br>    background: #EAF5FE;<br>    padding: 5px;<br>    font-weight: 400;<br>}<br><br>.scroll-bar {<br>    position: absolute;<br>    background-color: #fff;<br>    height: calc(100% - 20px);<br>    width: 80px;<br>    border: 1px solid #0B5CAB;<br>    display: flex;<br>    justify-content: center;<br>    opacity: 0;<br>    visibility: hidden;<br>    transition: opacity .3s ease-out;<br>    pointer-events: none;<br>}<br><br>.scroll-bar.visible {<br>    opacity: 1;<br>    visibility: visible;<br>    pointer-events: auto;<br>}<br><br>.scroll-bar.active {<br>    background-color: #0B5CAB;<br>}<br><br>.scroll-left {<br>    border-top-left-radius: 4px;<br>    border-bottom-left-radius: 4px;<br>}<br><br>.scroll-right {<br>    border-top-right-radius: 4px;<br>    border-bottom-right-radius: 4px;<br>    left: calc(100% - 80px);<br>}<br><br>.scroll-bar-content {<br>    display: flex;<br>    justify-content: center;<br>    align-items: center;<br>    position: fixed;<br>    flex-direction: column;<br>    width: 80px;<br>}<br><br>.scroll-text {<br>    font-size: 1rem;<br>    font-weight: 500;<br>}</pre><p>Please share your feedback it will help me coming up with more such content.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0743226b0fa5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web-Performance Optimisation Guide]]></title>
            <link>https://medium.com/@nitesh14028/web-performance-optimisation-guide-45acdcb5961?source=rss-e9550315cd74------2</link>
            <guid isPermaLink="false">https://medium.com/p/45acdcb5961</guid>
            <category><![CDATA[browser-hack]]></category>
            <category><![CDATA[network-performance]]></category>
            <category><![CDATA[web-performance]]></category>
            <dc:creator><![CDATA[nitesh kumar]]></dc:creator>
            <pubDate>Tue, 15 Aug 2023 17:24:11 GMT</pubDate>
            <atom:updated>2026-04-16T16:08:44.635Z</atom:updated>
            <content:encoded><![CDATA[<p>The average computation time taken by any client machine is hardly more than 3<strong>sec</strong> to compile and process entire JS, Html, Css, Images, … etc required for loading any web-site. The problem remain is how fast resources can be provided to client and keeping track of what web-site is doing every 100–200ms ?. And can we take advantage if this idle time ?. The main focus here is to enable web-site for user interaction asap.</p><p>Many company just by using following techniques and right set of product architecture able to reduce their load time by <strong>60%</strong>. Current organisation standard consider a website to gets load with-in <strong>3–4 sec</strong> and user can start interaction with it. The response time for any user event during web-site interaction shouldn’t take more than <strong>200ms</strong>. The e-commerce platform reported telling per year on average it loose around <strong>10%</strong> of it’s customers if response time for user event increases more than <strong>200ms</strong>.</p><p>I have used following techniques to improve my product performance and was able to reduce my product loading time by more than 5<strong>0%</strong> without doing any changes on the server-side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PpE7gpZM7Xxi62Gl" /><figcaption>Photo by <a href="https://unsplash.com/@brett_jordan?utm_source=medium&amp;utm_medium=referral">Brett Jordan</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Following are some useful sets of technique to consider for great performance of website:</p><ul><li>PreLoad</li><li>PreFetch</li><li>Fetchpriority</li><li>DNS-Prefetch or preconnect</li><li>HTTPS / HTTP2</li><li>Caching (King but used with bad cacheing design)</li><li>Web-worker</li><li>Fetch streams</li><li>Encoding request / response</li><li>Avoid redirect</li><li>TLS Connection to be kept alive</li><li>Caching network response</li><li>Manifest</li><li>Dynamic JS Import (WebPack, so..on.)</li><li>Responsive images, increased use of SVG and new bitmap formats</li><li>PRPL Pattern</li><li>Progressive Web-App</li></ul><p>Firstly, we need to understand how we can measure the performance of web-site and recognise the area of improvement.</p><p>Chrome Developer Console, Chrome lighthouse, Mozilla Developer Console, WebPageTest,..etc. These are some tool can help in tracking website performance in terms of network, client resource utilisation, DOM rendering, server response, ..etc. They can also give insights on what’s happening each milliseconds frame by frame.</p><blockquote>As we know, all web-sites are build with their individual purpose so, mentioned technique impact will change from site to site. The performance improvement will depend on the level of access individual web-site has and due diligence in understanding each piece of resources.</blockquote><p>PreLoad — use it to load only required resources that will reduce initial web-site rendering time.</p><p><strong>Before</strong></p><pre>&lt;link rel=&quot;stylesheet&quot; href=&quot;styles/main.css&quot; /&gt;</pre><p><strong>After</strong></p><pre>&lt;head&gt;<br>  &lt;meta charset=&quot;utf-8&quot; /&gt;<br>  &lt;title&gt;JS and CSS preload example&lt;/title&gt;<br>  &lt;link rel=&quot;preload&quot; href=&quot;style.css&quot; as=&quot;style&quot; /&gt;<br>  &lt;link rel=&quot;preload&quot; href=&quot;main.js&quot; as=&quot;script&quot; /&gt;<br>  &lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot; /&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;h1&gt;bouncing balls&lt;/h1&gt;<br>  &lt;canvas&gt;&lt;/canvas&gt;<br>  &lt;script src=&quot;main.js&quot;&gt;&lt;/script&gt;<br>&lt;/body&gt;</pre><p><strong>How it works</strong>:</p><p>Browser assign <strong>priority</strong> to network call when resources needs to be fetch. Based on these <strong>priority </strong>browser will decide which resource will be loaded next.</p><p>Remember browser has limit of network call per website at any given point. Hence the next resource will only be loaded if any one of call gets completed. ex: <em>Chrome at max allow 6 network call at this time.</em></p><p>Meanwhile the next sets of resource will be stored in browser with assigned priority.</p><p>Assigning preLoad tags simply tells browser that we will need these resource to render our website fast. Browser we do it best to serve you the resources as fast as possible and will start compiling code too.</p><blockquote>Analyse and use preLoad tag only for resources that will speed up initial browser paint, adding it to all resources will have no impact. <strong>Defer</strong> and <strong>Async</strong> should be thought well while using it with main.js file responsible for page load. It might create some problem in specific scenario.</blockquote><p>Prefetch — Load resources when it’s more like to be used by the user in future. It should be done at the end of resource loading process, so that web-site can be rendered as soon as possible. It speeds up future user-interaction.</p><pre>&lt;head&gt;<br>  ...<br>  &lt;link rel=&quot;prefetch&quot; href=&quot;/articles/&quot; as=&quot;document&quot;&gt;<br>  ...<br>&lt;/head&gt;</pre><p><strong>How it works:</strong></p><p>It is similar to preLoad but differ in case of use when we are certain the interaction with resources is bound to happen in future.</p><blockquote>User bandwidth is limited and unnecessary use of prefetch can increase web-site loading time.</blockquote><p>Fetchpriority — This attribute can be used with link, img, and script tags. The attribute allows you to specify the priority for resource types such as CSS, fonts, scripts, and images when downloaded using the supported tags.</p><p>Can also be used with fetch api. It take three attribute hight, low, auto.</p><pre>&lt;head&gt;<br>  ...<br>  &lt;link rel=&quot;preload&quot; href=&quot;/js/script.js&quot; as=&quot;script&quot; fetchpriority=&quot;low&quot;&gt;<br>  ...<br>&lt;/head&gt;<br>&lt;script&gt;<br>  fetch(&#39;https://example.com/&#39;, {priority: &#39;low&#39;})<br>  .then(data =&gt; {<br>    // Trigger a low priority fetch<br>  });<br>&lt;/script&gt;</pre><p>DNS-Prefetch or preconnect — On average <strong>200ms</strong> is used to resolve the dns address of single web-site if not found locally. We can save around 200ms for each cross-site resource download.</p><p>It significantly increase the performance when lot’s of cross-site resources is required by web-site.</p><pre>&lt;link rel=&quot;preconnect&quot; href=&quot;https://fonts.googleapis.com/&quot; crossorigin /&gt;<br>&lt;link rel=&quot;dns-prefetch&quot; href=&quot;https://fonts.googleapis.com/&quot; /&gt;</pre><p><strong>How it works:</strong></p><p>DNS-prefetch is used for dns-resolution of web-site if not found locally. Preconnect does dns-resolution as well as <strong>TLS</strong> handshake too.</p><blockquote><strong>Preconnect</strong> to be used when it’s likely that the resource downloading will start soon where as <strong>Dns-prefetch</strong> to be used if in near future we might require some resources from other web-site. Hence dns-resolution time will be saved.</blockquote><p>HTTPS / HTTP2 — These are already in market market for longer but using it doesn’t always provide faster data transfer.</p><p>HTTPS is now must for all website as it provides security but at the same time data transfer is bit slower as due to additional layer of security being added.</p><p>HTTP2 can provide significant performance improvement but caching the data will be challenging.</p><p><strong>How it works:</strong></p><p>HTTP2 can send all the data over single TCP connection. Since it is developed after HTTP/1.1 it’s designed with advantage of network multiplexing for faster data transfer. It also allow us to push the data to client even before client requested for it. Therefore it speed up the network performance but caching the data is still a problem. Also, pushing JS code to client before they asked for raise security concern in some scenario.</p><blockquote>HTTPS should be added to web-site it might not provide performance improvement but will help in other business needs like google SEO optimisation, etc. Also not much performance degrading will be observed.</blockquote><blockquote>HTTP2 should be added on both client and server side. It require HTTPS encryption too. Still it’s not support by all browser and is not backward compatible.</blockquote><p>Caching — It’s known to all but is not used with bad architecture design. Often I have seen web-site caching data as soon it is available or in some cases using asynchronous operation to cache the data. Asynchronous might have some performance gain but it’s not that straight forward and cost in total web-site rendering time.</p><p><em>Prefer </em><strong><em>Delayed cache / bulk cache / batch cache </em></strong><em>design, means only cache after the website is successfully rendered. During interaction with website cache data after delay of 100ms— 300ms.</em></p><p>Three widely used cache technique:</p><ul><li>Web-storage (session storage / local storage) — Synchronous, prefer storing less amount of data.</li><li>WebSql — Asynchronous</li><li>IndexedDB — Asynchronous, most widely used, large amount of storage, very slow storing large volume of data at once.</li></ul><p><strong>Problem with sync / async cache using indexedDB.</strong></p><p>If sync operation perform to store large amount of data it will block JS main thread thus increasing web-site load time. Even if async is used will not block JS main thread much but still there will be downtime in loading cache due to indexedDB.</p><p>IndexedDB is slow when it comes to storing large amount of data at once, Opening multiple indexedDB connection will decrease the performance. The web will looks to be hanged as resource compilation will be stop for a while.</p><p>It’s observed that if size of cache data increase beyond <strong>100KB</strong> it can easily cause a delay of more than <strong>4 sec</strong> to load the website.</p><p><strong>Bulk Cache</strong> — <strong>400KB</strong> of data can be easily cached within <strong>200–400 ms, </strong>by using single DbConnection.</p><p>Trigger event when website is completely loaded.</p><pre>const dataSet = {} //cache data stored in-memory until web-site is completely loaded.<br><br>const openIndexdatabase = () =&gt; new Promise(resolve =&gt; {<br>    let indexDatabase;<br>    try {<br>      if (self.indexedDB) {<br>        const request = self.indexedDB.open(databaseName, 1);<br>        request.onerror = function (event) {<br>          resolve(null);<br>        };<br>        request.onsuccess = function (event) {<br>          indexDatabase = request.result;<br>          resolve(indexDatabase);<br>        };<br>        request.onupgradeneeded = function (event) {<br>          indexDatabase = event.target.result;<br>          indexDatabase.createObjectStore(tableName, { keyPath: &#39;id&#39; });<br>        };<br>      } else {<br>        resolve(null);<br>      }<br>    } catch (e) {<br>      resolve(null);<br>    }<br>  });<br><br>const bulkInsertIndexedDB = (dataSet = []) =&gt; new Promise((resolve) =&gt; {<br>    try {<br>      let indexDatabase;<br><br>      openIndexdatabase()<br>        .then((conn) =&gt; {<br>          indexDatabase = conn;<br>        }).then(() =&gt; {<br>          const tr = indexDatabase.transaction([tableName], &#39;readwrite&#39;, { durability: &#39;relaxed&#39; });<br>          const store = tr.objectStore(tableName);<br>          tr.onerror = () =&gt; {<br>            indexDatabase.close();<br>            resolve(false);<br>          };<br>          tr.oncomplete = () =&gt; {<br>            indexDatabase.close();<br>            resolve(true);<br>          };<br><br>          for (let i = 0; i &lt; dataSet.length; i += 1) {<br>            const { key, value } = dataSet[i];<br>            store.put({ id: key, value });<br>          }<br>          tr.commit();<br>        });<br>    } catch (e) {<br>      resolve(false);<br>    }<br>  });<br><br>function webSiteLoadedComplete() {<br>  bulkInsertIndexedDB(dataSet);<br>}</pre><p><strong>Delayed / Batch Cache</strong>: Preferred while user is interacting with the web-site. Group cache data in batch. When first request come to cache data don’t store immediately wait for 200ms — 300ms if more data can be cache together. Meanwhile store data in-memory and serve from memory too.</p><pre>const __tempCachedItems = {};<br>let batchInsertItems = {};<br><br>setCacheItem = (key, value) =&gt; {<br>  __tempCachedItems[key] = value;<br>    batchInsertItems[key] = value;<br><br>    if (batchTimer) clearTimeout(batchTimer);<br><br>    batchTimer = setTimeout(() =&gt; {<br>      const copybatchInsertItems = { ...batchInsertItems };<br>      batchInsertItems = {};<br>      batchTimer = null;<br>      bulkInsert(copybatchInsertItems);<br><br>      // once bulkInsert completed delete data from __tempCachedItems.<br><br>    }, delay); // delay: (200 - 300 ms)<br>  }<br>  return Promise.resolve();<br>};</pre><blockquote><strong>Note</strong>: The above solution can easily decrease web-site load time by 4–5 sec if lots of data caching is needed. It will not impact much if data cache is very small in size. <strong>Encode</strong> data before cache to reduce it’s size.</blockquote><p>Web-worker — It’s been there for a long time but still used by very web-sites. Handing over the long running task / unnecessary task that will be impact web-site performance to web-worker will provide user a seems interaction with the web-site.</p><p><strong>Remember</strong> it recite in public scope of web-site, so during initialisation phase will need public path access. It can be created from <strong>public</strong> resource or <strong>inline code</strong>. As of now data can be only passed as an object.</p><pre>// inline web-worker: have to do additional work to create global public url.<br>const workerFunction = (function(DedicatedWorkerGlobalScope){<br>  const self = DedicatedWorkerGlobalScope;<br>  <br>  self.onmessage = (e) =&gt; {<br>    const {key, value, ...} = e.data;<br>    // operation.<br>    self.postMessage({key, value})<br>  }<br>  // code <br>}.toString());<br><br><br>const blobURL = URL.createObjectURL(<br>    new Blob([`(${<br>  &quot; add code here of import it from other file or function &quot;<br>  &quot;example&quot; workerFunction<br>})(this)`], { type: &#39;application/javascript&#39; })); // this is important.<br><br><br>if(window.Worker) {<br>  const webWorker = new Worker(blobURL);<br>  webWorker.onmessage = (e) =&gt; {<br>    const {key, value} = e.data;<br>  }<br>  webWorker.postMessage({key: &#39;001&#39;, value:&#39;testing...&#39;})<br>}<br><br>// web-worker part of public resouce <br>if (window.Worker) {<br>  const webWorker = new Worker(path); // path to public js file<br>}</pre><p><strong>How it works:</strong></p><p>Almost all web-site has a support of web-worker. It require it’s own dedicated scope and thread which is independent of main thread and Global scope. It can not directly impact your main thread or do changes in the UI. Also, doesn’t have access to Global scope. Though it can do a lot of things like network call, indexedDB access, event notification…etc.</p><blockquote><strong>Note: </strong>web-worker gets existed as soon as web-site is closed. Nowadays s<strong>ervice-worker</strong> is also supported by most of the browser which has totally different privilege, scope and can even exist if the web-site is close. Will discuss further in topic <strong>Progressive Web-App.</strong></blockquote><blockquote>Large Images and media files should be handed over to web-worker for decoding. As a single big image can easily take several hundred milliseconds to get decoded. Hence main thread will not be blocked.</blockquote><p>Fetch streams — Readable Streams can help to quickly parse the network data as soon as it’s received from server and processing on the data can start asap.</p><p><em>Without fetchStreams</em>: s<em>erver response →completed →decode →data processing. With fetchStreams: server response and decode →completed →data processing.</em></p><pre>const decoder = new TextDecoder();<br>const reader = response.body.getReader();<br>const response = [];<br><br>fetch(url).then((response) =&gt; {<br>  reader.read().then(function processResult(result) {<br>    if (result.done) return;<br>    response.push(decoder.decode(result.value, { stream: true })));<br>    return reader.read().then(processResult);<br>  }).then(() =&gt; response.join(&#39;&#39;));<br>});</pre><p><strong>How it works</strong>:</p><p>Doesn’t wait for complete server response as it starts decoding the chunk of data as soon as it’s received. It saves the extra time of decoding the server response. On average <strong>45% </strong>improvement per api performance is observed as per experiment.</p><blockquote>It will have significant impact if huge amount of data is received from server mostly in mb’s. If data transfer is small likely in kb’s then not much impact on performance. It’s More likely to be a extra layer of complication.</blockquote><p>Compress request / response — Gzip, deflate, or zlib compression is mostly widely used and is widely available on all browser platform. It provides performance benefit to by decreasing the data size.</p><p>Zopfli and Brotli are two compression algorithm from google. Zopfli compression decreases resources size around <strong>3%–8%</strong> and Brotli around <strong>25%</strong> greater than gzip for text-based files. As per Facebook brotli saves about <strong>17%</strong> of CSS bytes and <strong>20%</strong> of JavaScript bytes compared with gzip using Zopfli.</p><p>The compression time for both Zopfli and Brotli is much more than gzip, but decompression times remain same. Brotli needs browser support whereas Zopfli doesn’t need it.</p><blockquote>Prefer using it with static resources. Dynamic resource might take more time as compression is costly for these algorithm.</blockquote><p>Avoid redirect — Single redirects can easily add a delay of <strong>400ms</strong> to overall performance time.</p><p><strong>How it works:</strong></p><p>During redirects browser first need to fetch response of web-site and then again have to redirects to other url to fetch the required resources. There will be total 2 complete network cycle if just one redirect is needed. On average time taken for TLS handshake and establishing the TCP connection to single web-site server takes <strong>200ms</strong>. The rest delay depends on the resource size.</p><p>TLS Connection to be kept alive — It better to double check the request header parameter to have <em>connection: ‘kept-alive’. </em>Check while<em> </em>downloading<em> </em>multiple resources from cross-origin sites. Usually these parameter is set for same-origin site by the browser.</p><p>Caching network response — Through the server response header we can instruct browser to cache the data. “Cache-control” and “max-age” parameter needs to assigned with required values.</p><p><strong>How it works:</strong></p><p>When a network call instruct browser to cache the data it creates key: value pair where key:{request url} and value:{actual data}. So when same request is invoked browser serves data from it’s cache instead of server.</p><p>Browser can additional fire <strong>HEAD</strong> request to know if data in cache is old by comparing <strong>LastModifiedDate</strong> parameter. Then based on it will decide if reload is needed.</p><blockquote>Note: Static Resources cacheing are most common most of the web-site does it. We can cache dynamic resource too but needs to careful about max-age. Search based query can easily achieve <strong>throttling</strong> by having a max-age of <strong>200ms</strong>(recommended practice).</blockquote><p>Manifest — Manifest file can also help in caching application resource on client. If you have manifest by default index.html will be part of app Cache. It can also server web-site offline if all required resources are cached.</p><pre>&lt;html manifest=&quot;test.manifest&quot; &gt;<br>&lt;head&gt;<br>&lt;link href=&#39;//fonts.googgleapis.com/css?family=Raleway:300,400,600&#39; rel=&#39;stylesheet&#39; tye=&#39;text/css&#39;&gt;<br>&lt;link rel=&#39;stylesheet&#39; href=&#39;file1.css&#39;&gt;<br>&lt;link rel=&#39;stylesheet&#39; href=&#39;file2.css&#39;&gt;<br><br>&lt;script src=&#39;app.js&#39; /&gt;<br>&lt;/head&gt;<br>  ...<br>&lt;/html&gt;</pre><pre>CACHE MANIFEST<br><br>#This is comment, latest vesrion <br><br>CACHE:<br>file1.css<br>file2.css<br>app.js<br>//fonts.googgleapis.com/css?family=Raleway:300,400,600<br><br>NETWORK:<br>*</pre><pre>// Reload browser with updapted web-site everytime.<br>applicationCache.addEvenetListener(&#39;downloading&#39;, () =&gt; {<br>  // update user new version available.<br>});<br><br>applicationCache.addEvenetListener(&#39;updateready&#39;, () =&gt; {<br>  // alert user to reload(Recommened) or implict reload<br>});<br>applicationCache.addEvenetListener(&#39;error&#39;, () =&gt; {<br>  // app cache either update everything or nothing.<br>  // error can happen from other thrid party as well, it better to update user.<br>});</pre><p><strong>How it work</strong>:</p><p>Browser if finds manifest file will cache index.html and all the resources defined in manifest file. Every time web-site is visited by the client resources is served from local cache. Meanwhile browser also check if manifest file has been updated or not.</p><p>Remember with every new update on web-site static resource manifest needs to be updated. If there is no update in manifest file your changed resource will be loaded and cached in browser. The changed resources appear on <strong>second load</strong> of web-site. Simply by adding comment your manifest file will be updated. If you want to load web-site with latest resource do similar to above JS.</p><blockquote>Application cache by default doesn’t allow you to talk to outside world. If you have manifest browser thinks you have all the available resources. So, add <strong>NETWORK section with * </strong>to allow app cache communicate outside world and cache required resources.</blockquote><blockquote>Manifest are also used to store metaData, restricted access,… etc. Manifest updation can also be done by help of libraries.</blockquote><blockquote>Read more about manifest, application cache. Manifest can also be created dynamically through JS for dynamic url’s.</blockquote><blockquote>Application Cache is available everywhere all browsers, i-pad, kindle,… etc.</blockquote><p>Dynamic JS Import — Any SPA should at least contain two JS file instead of having single main.js file. One JS file should contain only necessary JS to load the web-site and all other JS file should be dynamically loaded to serve the business needs. Lot’s of framework or library available in the market easily provide such support.</p><p>WebPack is popular library which also provide dynamic JS import support. By creating multiple JS bundle. Code-splitting is powerful technique but require special attention on how many JS should be created. Creating lots of dynamic JS file is a bad design as it will add unnecessary network overhead. Also, we already know browser has limitation on max network call at any moment(chrome it’s 6 call).</p><blockquote>The JS file responsible for web-site loading should be loaded asap. Prefer using preload, caching,..etc. The rest JS file can be loaded in later point of time by giving fetchpriority=’low’, declaring at the end of index.html, …etc.</blockquote><blockquote>If Code-splitting is done too much, it will start creating problem than being a solution.</blockquote><blockquote>Try splitting images to it’s separate files likes main images of web-site and rest can be in it’s own separate bundle.</blockquote><p>Responsive images, increased use of SVG and new bitmap formats — Images are big file and takes lot of time to load, process and rendering on UI. For a content rich site it can cause huge delay like twitter, instagram, … etc. Big tech companies using multiple technique try to deliver content optimised as size, browser and client platform.</p><p>There are lot’s of thing that can be done here, Let’s discuss on them.</p><ul><li>Spritesmith(library) — take all images and icons and puts it into single or a few Spritesheets. So, instead of downloading all images, icons which can create network overhead we just need few Spritesheets. After this simply locate the images, icon and use it in web-site.</li><li>Responsive images —Creating <strong>n version</strong> of images within three platform(mobile, desktop, tablet). According to a report published by <a href="http://bit.ly/2IxXLlS">ScientiaMobile</a>, 84% improvement in data savings happen if we maintain different image version based on client screen size, pixel density, aspect ratio etc. The &lt;picture&gt; element now part of the HTML 5.1 specification is an container that provides multiple sources to its contained &lt;img&gt; element to allow authors to declaratively control or give hints to the user agent about which image resource to use, based on the screen’s pixel density, viewport size, image format, and other factors.</li><li><a href="http://bit.ly/2wrc4E8">HTTP Client Hints</a> — It is an extension to the HTTP protocol to support headers that will enable content negotiation between client and server based on hints sent by the browser. It can reduce the amount of &lt;source&gt; elements in a &lt;picture&gt; tag for Responsive Image.</li><li>Scale with Vectors — Although SVG is not new, it’s underused. It benefits in terms of size compression, doesn’t require several versions. Try using SVG wheresoever possible.</li><li>Decoding Images using web-worker — Decoding any big images can easily take few hundred milliseconds, it’s better to hand over the task to web-worker for efficient utilisation of main-thread.</li><li>New Bitmap Formats — Besides the well-known animated GIF, JPEG, and PNG formats, newer mobile and browsers support new formats that will help you in delivering smaller files with the same quality. Unfortunately, support for these formats is still browser-based, so the best option today is to use the &lt;picture&gt; element with the type</li></ul><pre>&lt;picture&gt;<br>    &lt;source type=&quot;image/heif&quot; src=&quot;image.heif&quot;&gt;<br>    &lt;source type=&quot;image/webp&quot; src=&quot;image.webp&quot;&gt;<br>    &lt;source type=&quot;image/vnd.ms-photo&quot; src=&quot;image.jxr&quot;&gt;<br>    &lt;source type=&quot;image/jp2&quot; src=&quot;image.jp2&quot;&gt;<br>    &lt;img src=&quot;image.png&quot; alt=&quot;description&quot;&gt;<br>&lt;/picture&gt;</pre><blockquote><strong>Note:</strong> If effort to create n version on image is a lot try considering CDN services, it provides different versions and other features like caching on region node,..etc to deliver content fast.</blockquote><p>PRPL Pattern — <a href="http://bit.ly/2HVGVOl">PRPL</a> is a design pattern to structure and serve a web app’s code to improve performance, achieving a fast Time to Interactive and maximising caching efficiency and simplicity of development.</p><p>Here’s what the acronym stands for and instructs you to do:</p><ul><li>Push critical resources for the initial URL route</li><li>Render initial route</li><li>PreCache remaining routes</li><li>Lazy-load and create remaining routes on demand</li></ul><blockquote>The pattern is still being tested by several companies, but it appears to be a solution to some of the Universal Rendering issues while keeping good interactivity and rendering metrics.</blockquote><p>Progressive Web-App — It’s talks about the design technique and pattern that a web-site should follow to build a high performance website. Companies has already started transitioning their web-site towards PWA.</p><p>Here is what you need to know for designing PWA:</p><ul><li>Counting every milliseconds — To build a performant web-site we should know what’s happening every milliseconds. Some data points to track server response time, first meaningful paint, last paint, first byte received, network call waterfall chart, … etc.</li><li><strong>Service-worker</strong>: These are persistent worker or background worker and will remain active even when user is not accessing the web-site / closed it. It can help to provide great deal of offline experience like sending notifications, etc. It has abilities of caching, push messaging, geo-fencing,..etc.</li><li>All performance techniques mentioned here and others design techniques… .</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45acdcb5961" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>