<?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 Bertrand Laot on Medium]]></title>
        <description><![CDATA[Stories by Bertrand Laot on Medium]]></description>
        <link>https://medium.com/@bertrandlaot?source=rss-524518446fb2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*IgA4gKmvo-HXRMv7Qe6SMg.jpeg</url>
            <title>Stories by Bertrand Laot on Medium</title>
            <link>https://medium.com/@bertrandlaot?source=rss-524518446fb2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 22:11:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bertrandlaot/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[The web performance culture on leroymerlin.fr (2/3) — Current web performance issues and problems]]></title>
            <link>https://medium.com/adeo-tech/the-web-performance-culture-on-leroymerlin-fr-2-3-current-web-performance-issues-and-problems-8706afdba213?source=rss-524518446fb2------2</link>
            <guid isPermaLink="false">https://medium.com/p/8706afdba213</guid>
            <category><![CDATA[http2]]></category>
            <category><![CDATA[assets]]></category>
            <category><![CDATA[web-performance]]></category>
            <category><![CDATA[waterfall]]></category>
            <dc:creator><![CDATA[Bertrand Laot]]></dc:creator>
            <pubDate>Wed, 06 Apr 2022 13:31:02 GMT</pubDate>
            <atom:updated>2022-05-19T10:09:04.698Z</atom:updated>
            <content:encoded><![CDATA[<h3>The web performance culture on leroymerlin.fr (2/3) — Current web performance issues and problems</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TprlCZ1MOQD7eq1N2J15DA.png" /></figure><p>This article follows the <a href="https://medium.com/adeo-tech/fostering-a-web-performance-culture-on-leroymerlin-fr-41619e1473d6">previous one</a> where I detailed the different tools we have used over the years on the Leroy Merlin France website. A good tool is nice, but it’s what you do with it that matters.</p><p>We are now going to discuss the issues and problems that these tools have brought to light and the solutions we have brought to them.</p><h3>HTTP2 and number of requests</h3><p>The promise of HTTP/2 is certainly appealing, especially when you’ve been subjected to HTTP/1 for a long time.<br>HTTP/1 forces you to limit the amount of requests because it lacks parallelization. The new HTTP/2 capacity about parallel resource loads enabled us to split our pages into autonomous fragments, a must-have in our micro-frontend. <br>But congestion quickly appeared on pages with a large number of fragments to download:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Tfafek7n4R8HEZZv" /></figure><p>Above, we can see a very large number of resources called in 2 distinct phases, before the product image (purple bars). All these resources are not necessarily useful for the display. The browser prioritizes resources according to their type (HTML, CSS and fonts have the highest priority by default) and we can quickly see that an over-division of resources can be counterproductive.</p><h3>How to share resources in micro front-ends?</h3><p>In a micro front-end context, each page is composed of autonomous fragments that are isolated from the rest of the page. To meet this need, a fragment must be properly scoped so that its CSS styles and JS scripts do not interfere. However, this led us to a dead end in terms of intelligent management of the CSS cascade and common JS functions sharing. We made the double-edged decision to create two common CSS and JS files. Be careful though: too many common resources will lead to a strong dependency between the fragments. This is even more dangerous because it is managed on the browser side.</p><h3>Critical and asynchronous resources</h3><p>As mentioned above, increasing the number of resources causes congestion in their loading. To display the page fast, we must tell the browser the priority of these resources.</p><h4><strong>How to define the priorities of resources loading</strong></h4><p>You have to consider 3 priority levels:</p><ol><li>critical resources</li><li>then: async &amp; defer</li><li>then: lazy load</li></ol><p>The most important resources are the one useful to display the viewport. But today, defining a standard viewport is a challenge. We have to find the right tradeoffs to test on both mobile &amp; desktop.</p><p><strong>Critical resources</strong> are those that are used for display inside the viewport identified on the main devices. We will have to make a compromise between mobile and desktop displays to define what is really critical.</p><p>Basically a &lt;link rel=”stylesheet”&gt; tag without any other tricks will make the CSS resource critical. This will force the browser to block its rendering to download this one and associate it with the document’s CSS tree. Same thing for a &lt;script&gt; tag where the code is not conditioned to a browser event (load, user click,…).</p><p>To avoid loading resources, we can write the content of these CSS and JS resources inline within the HTML document. But be careful not to overload the weight of the first HTML request too much: this will impact the TTFB (Time To First Byte).</p><p>Some JS resources must be loaded and executed early, but are not critical for the display. For these ressources, you should use <strong>async &amp; defer</strong>. Basically you just have to add a simple attribute on a &lt;script&gt; tag, and this will unblock the display and will not force the browser to wait for the resource to download and execute :</p><ul><li><em>async</em> does not block the browser from rendering and the script will be executed when it is available. Be careful though: the order of execution of the scripts will not necessarily be the same as in the code.</li><li><em>defer</em> also unblocks the display and tells the browser to execute the script once the DOM is ready and just before the DOMContentLoaded event. The order of the scripts in the page remains respected.</li></ul><p>Simple rule: any script should be asynchronous or deferred if it is not useful for the display — e.g. carousel or other complex UI element requiring JS.</p><p>For JS that don’t directly contribute to the user experience, and CSS that don’t contribute to the display inside the viewport, we use <strong>lazyload</strong>. This consists in attaching resource loads to a JS event — DOMContentLoaded or scroll for example. In <a href="https://medium.com/adeo-tech/behind-leroymerlin-fr-micro-frontends-47fd7c53f99d">Kobi, our micro front-end solution</a> this principle is transparent for the developer because they can indicate in their static resource declaration of their fragment if they want to leave them blocking, asynchronize or defer them, or lazyload them.</p><h4>What about HTTP server push?</h4><p>Finally, to speed up the loading of critical resources, we use the server push mechanism. It lets web servers preemptively send resources the client expects.</p><p>This feature seemed to be deprecated in Chrome (<a href="https://www.ctrl.blog/entry/http2-push-chromium-deprecation.html">https://www.ctrl.blog/entry/http2-push-chromium-deprecation.html</a>) but this post <a href="https://groups.google.com/a/chromium.org/g/blink-dev/c/K3rYLvmQUBY/m/0o4J1GEjAgAJ">https://groups.google.com/a/chromium.org/g/blink-dev/c/K3rYLvmQUBY/m/0o4J1GEjAgAJ</a> reassured us: the push server is maintained while waiting for a better solution.</p><p>Thanks to server push, the waterfall is slightly different. Resources download starts from the first bit received, as you can see below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3bCKtDFFo5f5-d8H" /></figure><p>Without server push, the browser waits longer before starting to load the resources. Here is the waterfall without server push:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/0*6BFZCwleSOh1-0w9" /></figure><h4>Caching resources on the client side</h4><p>Defining resources priorities would not make sense without a fine tuning of the client-side cache.</p><p>A CDN is a must for an optimal download of static resources. For this we use Fastly with a maximum expiration date — one month minimum. The resource path contains a version number: this allows us to avoid freshness constraints in the client’s browser.</p><p>We also use the localstorage to store some recurrent HTML sections of the pages of the site like for example the navigation menu and thus lighten the first HTML request.</p><p>Finally, we have studied the question of Service Workers (<a href="https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API">https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API</a>) which is very attractive but one question remains unanswered: which files should we avoid to load ? The hundreds of thousands of files and product families would simply be impossible to store on the browser, which led us to abandon the idea of filtering by page, but by elements instead. Today, we do not have a stateless philosophy and our first HTML requests always have a response code in 200. Many constraints back up this choice, notably the coherence of the data displayed on the page. Nevertheless, Services Workers are a subject that we keep on watch for a potential optimization lever.</p><h4>ES2015+ for newer browsers</h4><p>After all these tips, we can still go further with JS files.</p><p>The support of Javascript modules (https://caniuse.com/es6-module) is an interesting axis to serve ES2015 code to recent browsers with the nomodule attribute in fallback. However, we have kept an approach inherited from our old platform: to serve resources not transpiled according to the User Agent sent by the browser. The server takes care of the routing, which allows developers to develop in ES2015+ without worrying too much about IE11 and we have seen gains of about 30% on the weight of resources between ES5 and ES2015.</p><h3>The issue of third-party resources</h3><p><strong>Tag Management tools</strong> are essential to control dependencies of the site. Combined with a well written Content Security Policy in white list, we can have relative control of what is sent on our site. However, the quality of these solutions is quite uneven, and this is now our main challenge to improve the performance.</p><p><strong>A/B testing Solutions </strong>have an interest in blocking the display because they review the DOM and thus avoid the blinking effect. Without governance over their weight or the quality of the code produced, those can have a disastrous impact on the health of the site. We opted for Optimizely, among other things for its API that allows us to identify the pages where an AB test is active. It allows us to choose to write the &lt;script&gt; tag.</p><h3>Don’t forget the basics!</h3><h4>Image weight</h4><p>Using a CDN makes things easier: ours, Fastly, allows you to resize on the fly via a parameter in the URL. But a bad writing of it disables the functionality, and huge images appear on the site. The &lt;picture&gt; tag is available on all browsers, no more excuses to use the right image size for a given screen resolution (<a href="https://caniuse.com/">Caniuse</a>) and it degrades very well under IE11.</p><h4>Resource weight</h4><p>NPM is great, no way to tell otherwise, but watching the weight of the final JS file once built is even better. We have a strong tendency to obesity regarding the use of modules. It is sometimes more appropriate to develop your own snippet rather than bringing a NPM module and its dependencies. The global weight of the page is always an important indicator to follow to quickly detect these drifts, and is also part of the eco-index</p><h3>Conclusion</h3><p>These are some of the major problems we encountered during the technical redesign of the site and which still drive us daily in the development of new features. A continuous monitoring tool is therefore essential at this stage, as well as the accountability of the teams on the web performance KPIs. But what are the KPIs to follow? This will be the subject of a third and final article!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8706afdba213" width="1" height="1" alt=""><hr><p><a href="https://medium.com/adeo-tech/the-web-performance-culture-on-leroymerlin-fr-2-3-current-web-performance-issues-and-problems-8706afdba213">The web performance culture on leroymerlin.fr (2/3) — Current web performance issues and problems</a> was originally published in <a href="https://medium.com/adeo-tech">ADEO Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fostering a web performance culture on leroymerlin.fr]]></title>
            <link>https://medium.com/adeo-tech/fostering-a-web-performance-culture-on-leroymerlin-fr-41619e1473d6?source=rss-524518446fb2------2</link>
            <guid isPermaLink="false">https://medium.com/p/41619e1473d6</guid>
            <category><![CDATA[optimize-web-performance]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[leroy-merlin]]></category>
            <category><![CDATA[web-performance]]></category>
            <dc:creator><![CDATA[Bertrand Laot]]></dc:creator>
            <pubDate>Fri, 15 Oct 2021 09:08:08 GMT</pubDate>
            <atom:updated>2021-10-18T07:02:46.374Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dzrP2PR8db2Qa438J_wP6g.png" /></figure><h3>Fostering a web performance culture on leroymerlin.fr (1/3)</h3><h3>Who am I? Bertrand!</h3><p>I’ve been a front-end developer for 10 years now at Leroy Merlin France and I’ve been involved in Core Vitals themes since 2014.</p><p>My main focus over the last years has been Web performance. We have achieved a lot thanks to a widely adopted WebPerf culture. I want to tell you a story. At the beginning we were working on a legacy platform, a monolithic HTTP 1 frontend. And we managed to achieve a lot at this time. This article is focused on this period. If you are starting to look into Web performance you will find useful insights and actionnables.</p><p>In the following articles, I will explain what are the different evolutions (micro frontends, HTTP2) and how we are working today. Make sure to subscribe!</p><h3>At the beginning, in 2014…</h3><p>The work was focused on the back-end to improve server response times, the infrastructure for network times and the front-end for browser performance. To start our analysis, we used the following tools:</p><ul><li><strong>GTmetrix</strong></li></ul><p>GTmetrix combine multiple tools like Lighthouse and displays a good first global vision, especially a clear waterfall</p><ul><li><strong>Yellow labs</strong></li></ul><p>Gives more advanced and relevant recommendations than GTMetrix, especially by bringing the notion of render-blocking elements or DOM size</p><ul><li><strong>Web page Test</strong></li></ul><p>Available on webpagetest.org. This is the reference tool to calculate the Speed Index (definition here: <a href="https://docs.webpagetest.org/metrics/speedindex/">https://docs.webpagetest.org/metrics/speedindex/</a>).</p><p>We have come a long way in this adventure: our pages used to take several seconds to display at the time, and sometimes exceeded ten seconds. This led us to go through:</p><ul><li>lighter images</li><li>less requests</li><li>cleaning up unused, repeated CSS</li><li>minification / uglification of scripts</li><li>setting up a CDN on several domains</li><li>render blocking resources</li><li>and so on</li></ul><p>This approach allowed us to be first on the Journal du Net (a famous IT website in France) e-commerce ranking for the whole year 2016 (<a href="https://www.journaldunet.com/solutions/dsi/1176805-classement-la-webperf-des-tenors-du-e-commerce-en-france-en-mars/">https://www.journaldunet.com/solutions/dsi/1176805-classement-la-webperf-des-tenors-du-e-commerce-en-france-en-mars/</a>).</p><p>This ranking was not an end in itself. First of all, it was a clear highlight regarding the efforts of our teams, particularly in non-IT areas. Both marketing &amp; technical people were united around this challenge. From now on, web performance would remain a priority in project approaches.</p><p>To monitor our quality on web performance, we have mainly monitored these four indicators:</p><ul><li>TTFB — Time To First Byte: DNS resolution + SSL negotiation since we are in HTTPS + server response time + time to download the first byte</li><li>HTTP requests count</li><li>Total weight of all page resources and HTML page</li><li>Speed Index</li></ul><p>About SpeedIndex, Dareboost blogs has a very good article about it : <a href="https://blog.dareboost.com/fr/2018/02/speed-index-performance-web/">https://blog.dareboost.com/fr/2018/02/speed-index-performance-web/</a></p><h3>2018 : the birth of a new platform</h3><p>Starting in 2018, we started to adopt a Micro Front-end architecture. It’s for sure a challenge to maintain web performance with this new paradigm! Micro Front-end is required so we can add more people working on the website, ship more feature and bring at scale multiple use of LeroyMerlin.fr. Our WebPerf strategy had to change.We’ll write about these specific challenges in a next article.</p><blockquote><strong>Easy to read timeline about WebPerf at Leroy Merlin</strong></blockquote><blockquote>2014 : We started working on WebPerf. Main tools were GTmetrix, Yellow Labs, Web page test</blockquote><blockquote>2016 : <strong>Achievement </strong>: 1st position in Journal Du Net’s ranking. It allowed us to involve all stakeholders into Web performance.</blockquote><blockquote>2018 : Leroymerlin.fr is starting to adopt Micro Frontends paradigm. So we adapted our WebPerf strategy. You are reading this.</blockquote><p>At that time, the number of frontend developers increased tenfold to implement the new architecture. That’s in itself a challenge. We had to ensure that newcomers are well onboarded in our mission for Web Performance. And we had to bring them the tools and knowledge to do so.</p><p>At first, we focused on two projects to have leverage :</p><ul><li>Writing a repository of good practices, many of which concerned web performance</li><li>Using Dareboost’s solution for web page analysis to provide indicators</li></ul><p>Dareboost has several advantages, but the one that stands out the most, in my opinion, is the provided knowledge. In addition to a large number of metrics, the tool’s recommendations are always very relevant.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mV7RQQqttyM95d8U" /></figure><h3>Threshold strategy</h3><p>Web performance monitoring was very centralized. This was not a problem given the number of front-ends developers at that time but it had to be opened up to be effective with the growing number of teams. Every team had access to Dareboost to make shots and monitor if their pages were below these thresholds. They have been defined with the Leroy Merlin front-end community based on standards :</p><ul><li>TTFB &lt; 500ms</li><li>Speed Index &lt; 2000ms on desktop and &lt; 3000ms for mobile</li><li>Number of global requests below 100</li><li>Page weight under 800Kb</li></ul><p>These results did not take into account the third party resources because they penalized too much the scores of the requests and the weight and thus drowned problems related to the site itself. We did this because we were not monitoring the impact of third-party scripts on the CPU.</p><p>Thresholds enable us to maintain a high level of quality, even with a high number of teams, but it doesn’t allow us to achieve the best result possible.</p><h3>Need to have a common reference frame</h3><p>To challenge metrics, it is obvious to have a common repository to talk about it. Michel, a front-end developer who tests his mobile user experience by emulating Chrome desktop with a fiber connection, will inevitably have better results than Maurice with an Android 4.4 in 3G connected to his computer over USB.</p><p>Lighthouse is a very good tool made available in Chrome browsers, but above all it brought us a lot of noise. It contains the essential web performance KPIs but it is too dependent on the developer’s computer: connection, hardware and browser. Therefore, it is necessary to agree on a common base of figures to avoid wasting time in confrontation. A common tool in the company for monitoring metrics is therefore essential.</p><h3>From synthetic analysis to real user monitoring</h3><blockquote>Two definitions before going further:</blockquote><blockquote><strong>Synthetic analysis </strong>emulates user behavior. We configured this solution to be as close as possible to our users’ profile to carry out regular tests.</blockquote><blockquote><strong>Real User Monitoring (RUM)</strong> is not an emulation but captures real user behavior from the browser.</blockquote><h3>Monitor the “real” metrics, those of our users</h3><p>Until now, our analyses had always been synthetic. Synthetic analysis is very powerful because it allows us to go into the details of the page’s behavior, but it comes up against a major problem: how can we ensure that the test cases are relevant? Testing a desktop with fiber or an iPhone in 5G will inevitably bring back very good figures but it is advisable to be more pessimistic to better transcribe the user experience. Analyses of real user speeds are rare on this subject and remain global and not contextual to Leroy Merlin. For example, to calibrate our synthetic tests we used a Chrome Desktop ADSL and a Chrome on Android 8 with 4G based on ARCEP figures.</p><p>Real user monitoring allows us to get rid of this doubt by collecting field data. Today we use two tools to do this:</p><h3>Google CrUX</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/0*9_fG_uJly7NlbuiU" /></figure><p>More information here: <a href="https://developers.google.com/web/tools/chrome-user-experience-report">https://developers.google.com/web/tools/chrome-user-experience-report</a></p><p>Google CrUX is free and available without too much effort, it’s a very good solution to get webperf scores from the field. This is what the “Journal Du Net” has been based on since the beginning of the year. Beware, however, its limits are clearly announced by Google: it is only Chrome users who have given their consent and Google “chooses” the pages whose data it exposes.</p><p>This tool also gives additional data such as the connection of users.</p><h3>Speedcurve LUX</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kTRb5yh3fvH6ehdQ" /></figure><p>Where Google takes user data via its browser, Speedcurve collects it via an asynchronous tag dropped on the site. You have to put this tag on top of the page to collect relevant data. The earlier it will be declared, the more Speedcurve will be able to absorb all the timing of the page. We will find almost all the Core Web Vitals with notably the First Input Delay which is not possible to calculate in synthetic. The solution also allows us to follow the RUMs of the Single Page Application via a very simple API.</p><p>Synthetic and RUM are two complementary analyses: the RUM will be more useful for alerting and monitoring the state of health of the site, while the synthetic allows us to be better equipped to look for ways to improve.</p><h3>Speedcurve integrated in the development factory</h3><h3>Private agents for non-prod environments</h3><p>Speedcurve is based on the results of Webpagetest for its synthetic data. The problem of testing environments not accessible to the outside world with a SaaS solution often leads to concessions on security.</p><p>The problem is solved with the creation of a private Webpagetest agent hosted on our Google Cloud Platform zone. It is configured to receive test request events from Speedcurve and send back the data. Be careful with the readability of the results of these environments: the less stable they are (load tests, development environments), the less usable the webperf curves will be.</p><h3>Data integrated in Datadog and Google Datastudio</h3><p>The Speedcurve API allows you to extract synthetic data to make them available to teams and thus create interfaces that are more usable according to usage:</p><ul><li>We prefer Google Data Studio for more global communications to the group</li><li>Datadog for a finer monitoring and more exploitable in time by the development teams. It also allows you to correlate web performance data with other data such as deployment dates.</li><li>And access to Speedcurve for expert analysis to identify optimizations.</li></ul><p>As said above, the key to success is a common culture in the group for web performance with KPIs that everyone in the company is ready to achieve. The expertise comes from knowing the numbers and the data so that everyone can identify normal or faulty results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EslDG69yevv8gUeA" /></figure><h3>Alerting via Slack</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mCVYpLWhtcYZuKEg" /></figure><p>Boards are created in the Speedcurve interface to monitor each KPI on which a budget is set. A board concerns a page on a particular device. In case of overrun, an alert is now sent to a global Slack. We are in the process of onboarding the teams to associate page monitoring with dedicated perimeters.</p><p>After this first history and overview of the solutions we have implemented to monitor our web performance, we will see in a future article the issues that these data have raised and the solutions we have implemented to address them.</p><h3>What’s next !</h3><p>This article will be followed by two more. In the next article I will describe how we are working today. Especially now that HTTP2 is mainstream and micro-frontend are widely adopted and very well tooled at LeroyMerlin.fr. <br>Finally, in a third article, I will explain what are our next steps to ensure that LeroyMerlin stays ahead in terms of performance..</p><p>Are you having a KPI-overload reading this article ? This is happening to some of us too and you will read about it.</p><p>Make sure to subscribe to get notified when the next articles are released !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41619e1473d6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/adeo-tech/fostering-a-web-performance-culture-on-leroymerlin-fr-41619e1473d6">Fostering a web performance culture on leroymerlin.fr</a> was originally published in <a href="https://medium.com/adeo-tech">ADEO Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>