<?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 Pankaj Bisht on Medium]]></title>
        <description><![CDATA[Stories by Pankaj Bisht on Medium]]></description>
        <link>https://medium.com/@pankaj.bisht?source=rss-6248ced6c58c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Lk8zmBCmEl-rw6_4LoSa-w.jpeg</url>
            <title>Stories by Pankaj Bisht on Medium</title>
            <link>https://medium.com/@pankaj.bisht?source=rss-6248ced6c58c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 05:38:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pankaj.bisht/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[Core Web Vitals: How we did it?]]></title>
            <link>https://dineout.tech/core-web-vitals-how-we-did-it-e0477652e9fe?source=rss-6248ced6c58c------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0477652e9fe</guid>
            <category><![CDATA[dine-out]]></category>
            <category><![CDATA[web-best-practice]]></category>
            <category><![CDATA[web-optimization]]></category>
            <category><![CDATA[web-performance]]></category>
            <category><![CDATA[core-web-vitals]]></category>
            <dc:creator><![CDATA[Pankaj Bisht]]></dc:creator>
            <pubDate>Tue, 27 Jul 2021 14:12:38 GMT</pubDate>
            <atom:updated>2021-07-27T15:12:45.616Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T7uNyGpDrIrndePxtVGjIg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@mjessier?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Myriam Jessier</a> on <a href="https://unsplash.com/s/photos/google-analytics?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>User experience is a key in building any website, you can work on design &amp; content as much as you want, but if the webpage is not responsive, it’s not a great experience. Of course, you can work your way around and build a better technical infrastructure, and that’s the technical way of doing it. However, there is an intelligent way of increasing traffic and providing a quality user experience: Core Web Vitals.</p><p>The Core Web Vitals (CWV) are the epitome of the user’s page loading experience, interactivity, and visual stability. Ever since Google announced user page experience as a metric to rank pages on Google Search, CWV has become more critical than ever.</p><p><strong>What are the Core Web Vitals?</strong></p><p>The Core Web Vitals are a group of metrics that determines a score of an overall user experience for Google Search. These scores/ratings help developers track their website’s usability, performance, and effectiveness. Of course, getting a good CWV score is a task in itself. However, Google has simplified the scores into three Core metrics; website owners keep a check on these metrics scores and improve them time-to-time.</p><h3>The three metrics of the Core Web Vital</h3><p>To simplify the Core Web Vital overall score, Google came up with metrics. CWV is measured in three different metrics to rank pages on user experience:</p><ol><li><strong>LCP (Largest Contentful Paint): </strong>It measures the time to load up the largest content on the web page, e.g., image, text, or video. The higher the score, the faster the site is.</li><li><strong>FID (First Input Delay): </strong>It measures how long it takes for the site to react to the first interaction, e.g., a click on a CTA button. A lower FID means the site has a good response time.</li><li><strong>CLS (Cumulative layout shift): </strong>It measures the visual stability of the website, e.g., animation smoothness, object movement, etc.</li></ol><h3>What are Current UX Signals?</h3><h4>Mobile Usability:</h4><p>Unresponsiveness of the website visuals creates mobile usability issues. It creates complexity and makes it challenging for the user to navigate or find valuable information. Site owners must check if their website is not having these issues:</p><ul><li>Uses incompatible plugins</li><li>Viewport not set</li><li>Content wider than screen</li><li>Text too small to read</li><li>Clickable elements too close together</li></ul><h4>Security issues:</h4><p>A security issue for a site is a red signal; these issues must be addressed as quickly as possible. Any security issues for a site disqualifies all the URLs from the Good page experience status in Google Search.</p><h4>HTTPS :</h4><p>HTTPS everywhere! It is essential for a page to be served over HTTPS to be eligible for Good page experience status in Google Search.</p><h4>Ad Experience:</h4><p>Ad Experience rates whether a site uses distracting advertising techniques, interrupting, or otherwise not conducive to be a good user experience. The Ad Experience evaluation affects an entire site, not a single page.</p><h3>What is the Main Thread and how do we manage to free it?</h3><p>JavaScript is a single-threaded language, which means it has only one call stack to execute the program called “Main Thread”. As the page content loads, the browser’s main thread is busy running many tasks like parsing the HTML, building the DOM, and loading a JavaScript file. Since the main thread is already actively engaged in other tasks, the web page may not respond to user interactions, leading to a bad experience.</p><p>Let’s dive into how we have approached the problem. As we know that external JavaScripts are one of the significant components of a modern web application, it also serves as the major bottleneck to a page’s performance when you have a lot of javascript added to the page. However, there is a solution to the problem. An External javascript resource has two overheads, one the network download cost, two the parsing and execution cost. On Dineout PWA, we are using good practices like preload and adding script at bottom page body with an async attribute for all first-party javascript code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Zyag_oPrqwAb_eoX" /><figcaption>Preloading the critical resources</figcaption></figure><p>To add to this, we have decided to delay the loading of third-party scripts, most of the analytics stuff. We loaded the third-party scripts after the page load was completed. This delayed loading of third-party scripts allowed the main thread to be free. Also, on our product detail page, we have a Google map iframe to show the restaurant location, which internally loads its dependencies and slows down things further. So we have managed to delay its loading, and it does not come in the viewport in the first paint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*og1pNzwChj1ckc07" /><figcaption><em>Load external javascript with the async attribute at the bottom</em></figcaption></figure><h3>Load LCP Element Early</h3><p>On our PWA listing page, we have removed the image lazy loading from the first two search results because the image has to wait for the lazy load code to finish before starting to load pictures.</p><h3>No document write</h3><p>We have our application behind Akamai. Akamai has a RUM (Real user monitoring) tool called mpulse, which is added to the page document on the Akamai layer. This way of RUM injection is causing <a href="https://developers.google.com/web/updates/2016/08/removing-document-write"><strong>document.write</strong></a> on the page which increases blocking time, latency, and overall page loading times (especially, on slower internet connections). Also, if the DOM tree has already been constructed, document.write will force the browser to construct it again.</p><h3>Setting Analytics on Beacon Mode</h3><p>We have also enabled the beacon mode for google analytics, which avoids competing with time-critical operations and higher priority network requests.</p><h3>How did we Reduce the layout shift?</h3><p>Let’s look at the other core web vital “CLS,” As per Google Search Console, we had around 42k URLs that had a CLS score greater than 0.25 on mobile devices, which is categorized as <strong>POOR </strong>according to Google Search Console. We have added width and height attributes to the image element to solve this problem, causing these layout shifts. After our fixes, the poor URLs have become 0.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8ykrKShXAWclNE31" /><figcaption><em>The core web vital report of Dineout PWA.</em></figcaption></figure><h3><strong>Image Compression</strong></h3><p>We were using image CDN for serving our images but without any compression technique, which means images were not transmitted in an optimal manner. So we have used an image compression solution to deliver optimized and responsive images with the optimal format like WebP, JPEG-2000, which provide a better user experience and improves loading time. Here is a comparison for the same with pre and post-image compression.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IxttivfhGChA2Wrf" /><figcaption><em>Without Image Compression</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KLf6v6V-S0t9TyXG" /><figcaption>With Image Compression</figcaption></figure><h3><strong>Results:</strong></h3><p>You can also check out your website’s score on Google <a href="https://developers.google.com/speed/pagespeed/insights/?">PageSpeed Insights.</a> However, here is the overall impact of the above changes on our Dineout’s Page speed score.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*l3VSA-rBRmF9g-Fw" /></figure><h3>On an ending note:</h3><p>Improving performance and user experience is an evolving process. We add something here and something there, and it continues to grow more and more. There are few things that we are planning to add in the coming future, such as <a href="https://web.dev/content-visibility/">content visibility</a>. To be honest, initial POC has shown around 400ms of rendering time reduction on our listing page — that’s a great start. Experimenting with different tools and techniques does create some hurdles, but we always manage to slip through with another Js code. The Core Web Vitals are perhaps the most crucial part of website user experience, and if you know your way around, you can create the best user experience ever.</p><p>Thanks for reading; let me know your thoughts in the comment section below.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0477652e9fe" width="1" height="1" alt=""><hr><p><a href="https://dineout.tech/core-web-vitals-how-we-did-it-e0477652e9fe">Core Web Vitals: How we did it?</a> was originally published in <a href="https://dineout.tech/">Dineout Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>