<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Paul Calvano</title>
    <description>The latest articles on Forem by Paul Calvano (@paulcalvano).</description>
    <link>https://forem.com/paulcalvano</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F269230%2F5216c357-ba45-4a40-b050-debe7d64fc00.png</url>
      <title>Forem: Paul Calvano</title>
      <link>https://forem.com/paulcalvano</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/paulcalvano"/>
    <language>en</language>
    <item>
      <title>What can the HTTP Archive tell us about Largest Contentful Paint?</title>
      <dc:creator>Paul Calvano</dc:creator>
      <pubDate>Tue, 08 Jun 2021 03:59:31 +0000</pubDate>
      <link>https://forem.com/httparchive/what-can-the-http-archive-tell-us-about-largest-contentful-paint-f0p</link>
      <guid>https://forem.com/httparchive/what-can-the-http-archive-tell-us-about-largest-contentful-paint-f0p</guid>
      <description>&lt;p&gt;&lt;a href="https://web.dev/lcp/" rel="noopener noreferrer"&gt;Largest Contentful Paint (LCP)&lt;/a&gt; is an important metric that measures when the largest element in the browser’s viewport becomes visible. This could be an image, a background image, a poster image for a video, or even a block of text. The metric is measured with the &lt;a href="https://wicg.github.io/largest-contentful-paint/" rel="noopener noreferrer"&gt;Largest Contentful Paint API&lt;/a&gt;, which is &lt;a href="https://caniuse.com/?search=largestcontentfulpaint" rel="noopener noreferrer"&gt;supported&lt;/a&gt; in Chromium browsers. Optimizing for this metric is critical to end user experience, since it affects their ability to visualize your content.&lt;/p&gt;

&lt;p&gt;Google has promoted this metric as one of the three &lt;a href="https://web.dev/vitals/" rel="noopener noreferrer"&gt;"Core Web Vitals"&lt;/a&gt; that affect user experience on the web. It is also slated to become a &lt;a href="https://developers.google.com/search/blog/2021/04/more-details-page-experience" rel="noopener noreferrer"&gt;search ranking signal over the next few weeks&lt;/a&gt;, which has created a lot of awareness about it. The suggested target for a good Largest Contentful Paint is less than 2.5 seconds for at least 75% of page loads.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Flcp-httparchive%2Fimage9.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Flcp-httparchive%2Fimage9.jpg" alt="Largest Contentful Paint Overview"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;small&gt;Source: &lt;a href="https://web.dev/lcp/" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://web.dev/lcp/" rel="noopener noreferrer"&gt;https://web.dev/lcp/&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;

&lt;p&gt;Some of the recent posts on &lt;a href="https://wpostats.com/tags/core%20web%20vitals/" rel="noopener noreferrer"&gt;WPOStats&lt;/a&gt; feature interesting case studies about this metric.  For example, &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Google's &lt;a href="https://blog.chromium.org/2020/05/the-science-behind-web-vitals.html" rel="noopener noreferrer"&gt;research&lt;/a&gt; found that when Core Web Vitals are met, users are 24% less likely to abandon a page before it finishes loading.&lt;/li&gt;
&lt;li&gt;  Vodafone improved LCP by 31% and saw an 8% increase in sales.&lt;/li&gt;
&lt;li&gt;  NDTV improved their LCP by 55% and saw a 50% reduction in bounce rate.&lt;/li&gt;
&lt;li&gt;  Tokopedia improved their LCP by 55% and saw a 23% increase in session duration.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Identifying the Largest Contentful Paint Element&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The name of this metric implies that size is used as a proxy for importance. Because of this, you may be wondering specifically which image or text triggered it as well as the percentage of the viewport it consumed. There are a few ways to examine this:&lt;/p&gt;

&lt;p&gt;One way to visualize the Largest Contentful Paint is to look at a &lt;a href="https://webpagetest.org/" rel="noopener noreferrer"&gt;WebPageTest&lt;/a&gt; filmstrip. You’ll be able to see when visual changes occurred (yellow outline) as well as when the Largest Contentful Paint event occurred (red outline).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Flcp-httparchive%2Fimage7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Flcp-httparchive%2Fimage7.jpg" alt="WebPageTest Filmstrip showing LCP Element"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In Chrome DevTools, you can also click on the LCP indicator in the “Performance” tab to examine the Largest Contentful Paint element in your browser. Using this method you can see and inspect the exact element (image, text, etc) that triggered it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Flcp-httparchive%2Fimage11.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Flcp-httparchive%2Fimage11.gif" alt="Chrome DevTools Performance Tab"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lighthouse also has an audit that identifies the Largest Contentful Paint element. If you examine the screenshot below you’ll notice that there is a yellow box around the largest element, as well as an HTML snippet.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Flcp-httparchive%2Fimage5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Flcp-httparchive%2Fimage5.jpg" alt="Lighthouse LCP Element"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How Large is the Largest Contentful Paint?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://httparchive.org/" rel="noopener noreferrer"&gt;HTTP Archive&lt;/a&gt; runs Lighthouse audits for approximately 7.2 million websites every month. In the May 2021 dataset, Lighthouse was able to identify an LCP element in 97.35% of the tests. Since we have the ability to query all of these Lighthouse test results, we can analyze the result of the LCP audits and get more insight into what drives this metric across the web. &lt;/p&gt;

&lt;p&gt;Using the same boundaries that Lighthouse uses to draw the rectangle around the LCP element, it’s possible to calculate the area of it. In the above example, the product of the LCP image’s height (191) and width (340) was 64,940 pixels. Since the Lighthouse test was run with an emulated &lt;a href="https://almanac.httparchive.org/en/2020/methodology#webpagetest" rel="noopener noreferrer"&gt;Moto G4 user agent&lt;/a&gt; with a screen size of 640x360, we can also calculate that this particular LCP image took up 28% of the viewport.&lt;/p&gt;

&lt;p&gt;The graph below shows the cumulative distribution of the LCP element as a percentage of screen size. The median LCP element takes up 31% of the screen size! At the 75th percentile the LCP element is nearly twice as large, taking up 59% of the screen size. Additionally 10.6% of sites actually had an LCP element that exceeded the viewport (which is why the y axis doesn’t reach 100%).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Flcp-httparchive%2Fimage10.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Flcp-httparchive%2Fimage10.jpg" alt="Distribution of LCP Element Size as a Percent of Screen Size"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The graph below illustrates the same data in a histogram. From this we can see that 4.03% of sites (285,751) had a LCP element that took up 0 pixels. Upon further inspection, the 0 pixel elements appear to have been used in carousels, so by the time the audit completed the LCP element slid out of the viewport.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Flcp-httparchive%2Fimage3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Flcp-httparchive%2Fimage3.jpg" alt="Histogram of LCP Element Size as a Percent of Screen Size"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Node Paths of LCP Elements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Another interesting aspect of the Largest Contentful Paint audit is the nodePath of the element, which shows you where in the DOM this element was. In the example we looked at earlier, the nodePath was:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1,HTML,1,BODY,8,DIV,2,SECTION,1,DIV,0,DIV,0,DIV,0,UL,0,LI,0,ARTICLE,1,DIV,0,DIV,0,A,0,IMG
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we look at the last element in the node path, we can get some insight into the type of element that triggered the Largest Contentful Paint. The most common node that triggered the Largest Contentful Paint was &amp;lt;IMG&amp;gt;, which accounted for 42% of all sites.   Next was &amp;lt;DIV&amp;gt; at 27% (which could include text or images). The &amp;lt;H1&amp;gt; through &amp;lt;H5&amp;gt; header elements accounted for 7.18% of all Largest Contentful Paints.  &lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tr&gt;
   &lt;td&gt;LCP Node (last element in path)
   &lt;/td&gt;
   &lt;td&gt;Number of Sites
   &lt;/td&gt;
   &lt;td&gt;Percent of Sites
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;IMG
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
3067354&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
42.12%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;DIV
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
1981416&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
27.21%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;P
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
766977&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
10.53%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;H1
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
291091&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
4.00%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
192498&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
2.64%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;SECTION
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
182267&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
2.50%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;H2
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
144534&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
1.98%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;A
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
107501&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
1.48%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;SPAN
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
85245&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
1.17%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;HEADER
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
67762&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
0.93%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;LI
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
64212&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
0.88%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;H3
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
60679&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
0.83%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;RS-SBG
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
51623&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
0.71%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;TD
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
48470&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
0.67%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;H4
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
19039&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
0.26%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;VIDEO
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
15649&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
0.21%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;ARTICLE
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
12860&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
0.18%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;FIGURE
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
9208&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
0.13%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;BODY
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
8859&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
0.12%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;image
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
8077&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
0.11%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;CENTER
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
7960&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
0.11%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The &amp;lt;VIDEO&amp;gt; element only accounted for 0.21% of sites. According to the Web Almanac, &lt;a href="https://almanac.httparchive.org/en/2020/media#videos" rel="noopener noreferrer"&gt;the &amp;lt;video&amp;gt; element was used on 0.49% of mobile websites&lt;/a&gt; - so from this we can estimate that half of sites loading videos are triggering LCP with video poster images.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Image Weight for the LCP&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the Lighthouse audits looks for opportunities to preload the Largest Contentful Paint element, and estimates the potential savings in performance. This audit also identifies the URL for the LCP element - which can give us some insights into what type of images are being loaded as a LCP element. In the HTTP Archive data, only 67% of the Lighthouse tests were able to identify a URL for an LCP element. Based on this, we can infer that text nodes are used for the LCP on approximately 33% of sites.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Flcp-httparchive%2Fimage8.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Flcp-httparchive%2Fimage8.jpg" alt="Lighthouse Preload LCP Element Recommendation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The graph below shows the distribution of sizes for the image element that was associated with the Largest Contentful Paint. The median LCP element size was 80KB. At the 90th percentile, the LCP element size was 512KB.   If you have a large LCP image then you should consider optimizing it before you attempt to follow the Lighthouse preload recommendation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Flcp-httparchive%2Fimage12.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Flcp-httparchive%2Fimage12.jpg" alt="Distribution of LCP Element Size"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Additionally, 70% of the LCP element images were JPEG and 25% were PNG.  Only 3% of sites served a webp as their LCP element.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tr&gt;
   &lt;td&gt;format
   &lt;/td&gt;
   &lt;td&gt;sites
   &lt;/td&gt;
   &lt;td&gt;% of Sites
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;jpg
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
3161991&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
69.37%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;png
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
1122585&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
24.63%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;webp
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
141441&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
3.10%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;gif
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
84829&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
1.86%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;svg
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
34123&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
0.75%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Other
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
13272&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
0.29%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;When we look at the LCP element as a percentage of page weight, we can see that the median LCP element is 4.17% of the total page weight. At the higher percentiles, the LCP elements are larger and also a larger percentage of page weight.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Flcp-httparchive%2Fimage1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Flcp-httparchive%2Fimage1.jpg" alt="LCP Element as a Percent of Page Weight"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tr&gt;
   &lt;td&gt;percentile
   &lt;/td&gt;
   &lt;td&gt;ImageRequests
   &lt;/td&gt;
   &lt;td&gt;ImageKB
   &lt;/td&gt;
   &lt;td&gt;TotalKB
   &lt;/td&gt;
   &lt;td&gt;LCP as a % of Page Weight
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;p25
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
15&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
422&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
1,138&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
3.01%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;p50
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
26&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
1,142&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
2,185&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
4.17%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;p75
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
45&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
2,692&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
4,108&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
5.58%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;p95
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
103&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
8,008&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
10,036&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
8.42%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Since images account for 52% of the median page weight (for the sites that have a LCP image element), we can infer that at the median 8% of page weight is used to render content to 31% of the screen. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does this change based on Site Popularity?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The HTTP Archive now contains rank groupings, obtained from the Chrome User Experience Report.   This can enable us to segment this analysis based on the popularity of sites.  The rank grouping indicator buckets sites into the top 1K, 10K, 100K, 1 million and 10 million. &lt;/p&gt;

&lt;p&gt;When we look at the Largest Contentful Paint image size based on popularity, it’s interesting to note that the most popular sites tend to be serving smaller images for the LCP element. While there may be numerous reasons for this, I suspect that the more popular sites are investing in image optimization solutions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Flcp-httparchive%2Fimage2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Flcp-httparchive%2Fimage2.jpg" alt="LCP Image Size by Site Popularity"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Page weight follows the same pattern, with the least popular websites having some of the largest page weights. If we look at the LCP element based on the percentage of page weight, you can see that within the top 100K sites the ratios are very close. In the less popular sites, the LCP element tends to be a much greater percentage of page weight.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tr&gt;
   &lt;td colspan="5"&gt;
&lt;strong&gt;Largest Contentful Paint Image as a Percentage of Page Weight&lt;/strong&gt;
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;
&lt;strong&gt;rank&lt;/strong&gt;
   &lt;/td&gt;
   &lt;td&gt;
&lt;strong&gt;p25&lt;/strong&gt;
   &lt;/td&gt;
   &lt;td&gt;
&lt;strong&gt;p50&lt;/strong&gt;
   &lt;/td&gt;
   &lt;td&gt;
&lt;strong&gt;p75&lt;/strong&gt;
   &lt;/td&gt;
   &lt;td&gt;
&lt;strong&gt;p95&lt;/strong&gt;
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Top 1k
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
1.61%&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
2.12%&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
2.85%&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
5.67%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Top 10k
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
1.76%&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
2.27%&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
3.00%&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
4.96%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Top 100k
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
2.07%&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
2.87%&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
3.77%&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
5.78%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Top 1 million
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
2.53%&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
3.49%&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
4.60%&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
6.95%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Top 10 million
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
3.11%&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
4.30%&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
5.75%&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
8.65%&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;We can also make some interesting observations about how popular sites are optimizing their LCP assets. Looking at the various image formats, JPG images are the most common LCP element. Some other formats such as PNG, WebP, GIF and SVG are used more frequently in the more popular sites. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Flcp-httparchive%2Fimage6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Flcp-httparchive%2Fimage6.jpg" alt="Largest Contentful Paint Element Format by Rank"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Largest Contentful Paint is an important metric that helps illustrate when a page’s most significant content is rendered to the screen. In reviewing the HTTP Archive data, we can see that this area represents between 30% and 60% of a mobile viewport for a majority of sites.  &lt;/p&gt;

&lt;p&gt;There are a shocking number of sites that have a LCP element that consumes a large percentage of the viewport and are delivered as large unoptimized images. Site owners should evaluate both what is triggering the Largest Contentful Paint as well as how it is loaded. Optimizing for the Largest Contentful Paint will ensure that the browser has the opportunity to load and render this content as quickly as possible.&lt;/p&gt;

&lt;p&gt;If you are interested in seeing some of the SQL queries and raw data used in this analysis, I’ve created a post with all the details in the &lt;a href="https://discuss.httparchive.org/t/analyzing-largest-contentful-paint-stats-via-lighthouse-audits/2166" rel="noopener noreferrer"&gt;HTTP Archive discussion forums&lt;/a&gt;. You can also see all the data used for these graphs in this &lt;a href="https://docs.google.com/spreadsheets/d/1fI_16nby3Yn1LHxWVd4QRyOuPqqMLmBvBU31l5kGF-8/edit?usp=sharing" rel="noopener noreferrer"&gt;Google Sheet&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Originally posted at &lt;a href="https://paulcalvano.com/2021-06-07-lcp-httparchive/" rel="noopener noreferrer"&gt;https://paulcalvano.com/2021-06-07-lcp-httparchive/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webperf</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Growth of the Web in 2020</title>
      <dc:creator>Paul Calvano</dc:creator>
      <pubDate>Tue, 29 Sep 2020 19:28:48 +0000</pubDate>
      <link>https://forem.com/httparchive/growth-of-the-web-in-2020-20di</link>
      <guid>https://forem.com/httparchive/growth-of-the-web-in-2020-20di</guid>
      <description>&lt;p&gt;For the past 10 years, the &lt;a href="https://httparchive.org/" rel="noopener noreferrer"&gt;HTTP Archive&lt;/a&gt; has tracked the evolution of the web by archiving the technical details of desktop and mobile homepages. During its early years, the &lt;a href="https://www.alexa.com/topsites" rel="noopener noreferrer"&gt;Alexa top million&lt;/a&gt; dataset (which was publicly available until 2017) was used to source the list of URLs included in the archive and the number of sites tracked increased from 16K to almost 500K as testing capacity increased. To keep the archive current and include new sites, towards the end of 2018 we started using the &lt;a href="https://developers.google.com/web/tools/chrome-user-experience-report" rel="noopener noreferrer"&gt;Chrome User Experience Report&lt;/a&gt; as a source of the URLs to track. &lt;/p&gt;

&lt;p&gt;Throughout 2019 the size of the HTTP Archive dataset was mostly constant. However, the sample size has grown quite a bit in 2020 as you can see in the graph below! Additionally, if we combine both desktop and mobile URLs, there was a recent peak of 7.5 million sites!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Fgrowth-of-the-web-in-2020%2Fimage1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Fgrowth-of-the-web-in-2020%2Fimage1.jpg" alt="HTTP Archive Sample Size Trend"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How are sites Included in the Chrome User Experience Report&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;The Chrome User Experience Report (CrUX) is sourced from performance data collected from real Chrome users that have opted into syncing their browser history and sharing anonymized usage statistics reporting.It’s essentially real user measurement (RUM) data for Chrome users.&lt;/p&gt;

&lt;p&gt;You can read more about CrUX on &lt;a href="https://developers.google.com/web/tools/chrome-user-experience-report" rel="noopener noreferrer"&gt;Google’s Developer website&lt;/a&gt;, as well as this informative &lt;a href="https://web.dev/chrome-ux-report/" rel="noopener noreferrer"&gt;blog post from Rick Viscomi&lt;/a&gt;. I’ve also written about it previously &lt;a href="https://paulcalvano.com/2018-04-26-using-googles-crux-to-compare-your-sites-rum-data-w-competitors/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;While Google doesn’t publish a definitive list on what it takes to be included in the Chrome User Experience Report dataset, they have &lt;a href="https://groups.google.com/a/chromium.org/g/chrome-ux-report/c/kVKP6LZpk7U/m/rYbcEXiCCQAJ" rel="noopener noreferrer"&gt;indicated&lt;/a&gt; that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Origins are automatically curated based on real-user Chrome usage&lt;/li&gt;
&lt;li&gt;Websites must meet a traffic threshold to be included.&lt;/li&gt;
&lt;li&gt;Websites must be publicly accessible&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Essentially, a website’s inclusion in the Chrome User Experience Report indicates that they’ve reached a certain threshold of activity. According to the CrUX &lt;a href="https://developers.google.com/web/tools/chrome-user-experience-report/bigquery/changelog" rel="noopener noreferrer"&gt;changelog&lt;/a&gt;, there have been no changes in the methodology.  So it can be inferred that analyzing the number of websites included in this dataset should provide some interesting insights into the month on month growth of the number of websites being visited by real users.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: The Chrome User Experience Report does not contain traffic details, and as such this analysis should not be interpreted as growth of traffic on the internet.  This analysis is specifically about the growth in the number of websites that people are visiting.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Global Growth of Origins Accessed in 2020&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The graph below illustrates the total number of websites that the Chrome User Experience reported across all form factors during the previous 12 months. There are a few interesting observations we can make:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In both 2019 and 2020 there were increases in the number of websites at the start of the year.&lt;/li&gt;
&lt;li&gt;There was a linear increase in the number of websites through the first half of 2020. &lt;/li&gt;
&lt;li&gt;The drop in March and April 2020 is interesting, since that coincides with the start of the global COVID-19 pandemic.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Fgrowth-of-the-web-in-2020%2Fimage2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Fgrowth-of-the-web-in-2020%2Fimage2.jpg" alt="CrUX Origins Per Month"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is a similar pattern with the total number of registered domains.  This indicates that much of the growth is new domains and not necessarily subdomains of existing domains. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Fgrowth-of-the-web-in-2020%2Fimage3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Fgrowth-of-the-web-in-2020%2Fimage3.jpg" alt="CrUX Registered Domains Per Month"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we look at the month over month rate of change, you can see that the max change in 2019 was +/- 5%. The number of sites tends to fluctuate month to month. For example, between August and December 2019 there was an 8.6% decrease in sites. However at the start of 2020 there was a 7.5% increase. &lt;/p&gt;

&lt;p&gt;When comparing the number origins between December 2019 and August 2020, the total number of origins increased by 28.9% this year alone! That’s huge!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Fgrowth-of-the-web-in-2020%2Fimage4.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Fgrowth-of-the-web-in-2020%2Fimage4.jpg" alt="CrUX Month/Month Change in Origins and Registered Domains"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mobile vs Desktop Growth&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Looking at this by device type, we can see that there are consistently more mobile websites compared to desktop websites.  And over the past year the fluctuations between them have been fairly consistent.  The one exception is between May 2020 and June 2020, where desktop increased by 0.7% and mobile increased by 6.2%.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Fgrowth-of-the-web-in-2020%2Fimage5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Fgrowth-of-the-web-in-2020%2Fimage5.jpg" alt="CrUX Origins Per Month by Form Factor"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Overall, there are 22.9% more mobile websites in the CrUX dataset compared to desktop.  We know from sources like &lt;a href="https://gs.statcounter.com/platform-market-share/desktop-mobile-tablet/worldwide/#monthly-201908-202008" rel="noopener noreferrer"&gt;statcounter&lt;/a&gt; that mobile usage has grown significantly over the years, and consistently surpasses desktop.  But why are mobile users navigating to so many more websites compared to desktop users? &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Fgrowth-of-the-web-in-2020%2Fimage6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Fgrowth-of-the-web-in-2020%2Fimage6.jpg" alt="Desktop vs Mobile vs Tablet Market Share"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Is there something about the mobile experience (such as social media links, email marketing, etc) that increases the change a user may navigate to an unfamiliar website?  &lt;/p&gt;

&lt;p&gt;Or could it be growth in regions where mobile is more dominant? &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How Has this Varied by Region?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At the start of 2020, most regions of the world saw an increase in the domain of sites. The exception to this was western Asia. The regions that had the most substantial increase at the start of the year were Northern Europe, North America and South America.&lt;/p&gt;

&lt;p&gt;Between May and June there was another large uptick in the number of sites. This appeared to be mostly South-East Asian and Western European countries&lt;/p&gt;

&lt;p&gt;The tables below detail the number of sites included in the CrUX dataset during December 2019 as well as January, May and June 2020.  This first table contains the top 10 regions, most of which saw an increase of 15% to 25% during the previous six months!&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th colspan="5"&gt;Number of Sites Included in CrUX dataset&lt;/th&gt;
&lt;/tr&gt;&lt;/thead&gt;
&lt;thead&gt;&lt;tr&gt;
&lt;th&gt;Sub Region&lt;/th&gt;
&lt;th&gt;Dec 2019&lt;/th&gt;
&lt;th&gt;Jan 2020&lt;/th&gt;
&lt;th&gt;May 2020&lt;/th&gt;
&lt;th&gt;June 2020&lt;/th&gt;
&lt;th&gt;August 2020&lt;/th&gt;
&lt;/tr&gt;&lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
&lt;td&gt;Northern America&lt;/td&gt;
&lt;td&gt;1,257,159&lt;/td&gt;
&lt;td&gt;1,406,284&lt;/td&gt;
&lt;td&gt;1,676,120&lt;/td&gt;
&lt;td&gt;1,681,454&lt;/td&gt;
&lt;td&gt;1,730,260&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Western Europe&lt;/td&gt;
&lt;td&gt;713,202&lt;/td&gt;
&lt;td&gt;768,644&lt;/td&gt;
&lt;td&gt;874,164&lt;/td&gt;
&lt;td&gt;908,560&lt;/td&gt;
&lt;td&gt;943,891&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Eastern Europe&lt;/td&gt;
&lt;td&gt;640,145&lt;/td&gt;
&lt;td&gt;694,632&lt;/td&gt;
&lt;td&gt;821,024&lt;/td&gt;
&lt;td&gt;913,037&lt;/td&gt;
&lt;td&gt;926,202&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Eastern Asia&lt;/td&gt;
&lt;td&gt;720,926&lt;/td&gt;
&lt;td&gt;740,767&lt;/td&gt;
&lt;td&gt;871,854&lt;/td&gt;
&lt;td&gt;882,322&lt;/td&gt;
&lt;td&gt;901,008&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;South America&lt;/td&gt;
&lt;td&gt;486,894&lt;/td&gt;
&lt;td&gt;540,685&lt;/td&gt;
&lt;td&gt;668,604&lt;/td&gt;
&lt;td&gt;726,410&lt;/td&gt;
&lt;td&gt;784,854&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Southern Europe&lt;/td&gt;
&lt;td&gt;506,054&lt;/td&gt;
&lt;td&gt;541,526&lt;/td&gt;
&lt;td&gt;661,416&lt;/td&gt;
&lt;td&gt;710,543&lt;/td&gt;
&lt;td&gt;724,323&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Northern Europe&lt;/td&gt;
&lt;td&gt;453,591&lt;/td&gt;
&lt;td&gt;516,527&lt;/td&gt;
&lt;td&gt;601,459&lt;/td&gt;
&lt;td&gt;638,744&lt;/td&gt;
&lt;td&gt;661,790&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;South-Eastern Asia&lt;/td&gt;
&lt;td&gt;473,962&lt;/td&gt;
&lt;td&gt;485,143&lt;/td&gt;
&lt;td&gt;524,249&lt;/td&gt;
&lt;td&gt;584,214&lt;/td&gt;
&lt;td&gt;629,815&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Southern Asia&lt;/td&gt;
&lt;td&gt;403,325&lt;/td&gt;
&lt;td&gt;419,118&lt;/td&gt;
&lt;td&gt;441,328&lt;/td&gt;
&lt;td&gt;462,282&lt;/td&gt;
&lt;td&gt;500,600&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Western Asia&lt;/td&gt;
&lt;td&gt;274,339&lt;/td&gt;
&lt;td&gt;273,610&lt;/td&gt;
&lt;td&gt;327,425&lt;/td&gt;
&lt;td&gt;351,186&lt;/td&gt;
&lt;td&gt;362,340&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th colspan="5"&gt;Percent Change of Sites Included in CrUX dataset&lt;/th&gt;
&lt;/tr&gt;&lt;/thead&gt;
&lt;thead&gt;&lt;tr&gt;
&lt;th&gt;Sub Region&lt;/th&gt;
&lt;th&gt;Dec 2019 - Jan 2020&lt;/th&gt;
&lt;th&gt;May - Jun 2020&lt;/th&gt;
&lt;th&gt;Jun - Aug 2020&lt;/th&gt;
&lt;th&gt;Dec - Aug 2020&lt;/th&gt;
&lt;/tr&gt;&lt;/thead&gt;
&lt;tbody&gt;
 &lt;tr&gt;
&lt;td&gt;Northern America&lt;/td&gt;
&lt;td&gt;10.60%&lt;/td&gt;
&lt;td&gt;0.32%&lt;/td&gt;
&lt;td&gt;2.82%&lt;/td&gt;
&lt;td&gt;27.34%&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Western Europe&lt;/td&gt;
&lt;td&gt;7.21%&lt;/td&gt;
&lt;td&gt;3.79%&lt;/td&gt;
&lt;td&gt;3.74%&lt;/td&gt;
&lt;td&gt;24.44%&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Eastern Europe&lt;/td&gt;
&lt;td&gt;7.84%&lt;/td&gt;
&lt;td&gt;10.08%&lt;/td&gt;
&lt;td&gt;1.42%&lt;/td&gt;
&lt;td&gt;30.88%&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Eastern Asia&lt;/td&gt;
&lt;td&gt;2.68%&lt;/td&gt;
&lt;td&gt;1.19%&lt;/td&gt;
&lt;td&gt;2.07%&lt;/td&gt;
&lt;td&gt;19.99%&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;South America&lt;/td&gt;
&lt;td&gt;9.95%&lt;/td&gt;
&lt;td&gt;7.96%&lt;/td&gt;
&lt;td&gt;7.45%&lt;/td&gt;
&lt;td&gt;37.96%&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Southern Europe&lt;/td&gt;
&lt;td&gt;6.55%&lt;/td&gt;
&lt;td&gt;6.91%&lt;/td&gt;
&lt;td&gt;1.90%&lt;/td&gt;
&lt;td&gt;30.13%&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Northern Europe&lt;/td&gt;
&lt;td&gt;12.18%&lt;/td&gt;
&lt;td&gt;5.84%&lt;/td&gt;
&lt;td&gt;3.48%&lt;/td&gt;
&lt;td&gt;31.46%&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;South-Eastern Asia&lt;/td&gt;
&lt;td&gt;2.30%&lt;/td&gt;
&lt;td&gt;10.26%&lt;/td&gt;
&lt;td&gt;7.24%&lt;/td&gt;
&lt;td&gt;24.75%&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Southern Asia&lt;/td&gt;
&lt;td&gt;3.77%&lt;/td&gt;
&lt;td&gt;4.53%&lt;/td&gt;
&lt;td&gt;7.65%&lt;/td&gt;
&lt;td&gt;19.43%&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Western Asia&lt;/td&gt;
&lt;td&gt;-0.27%&lt;/td&gt;
&lt;td&gt;6.77%&lt;/td&gt;
&lt;td&gt;3.08%&lt;/td&gt;
&lt;td&gt;24.29%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Looking at the next 10 in the list, we can see significant growth in Central America, Australia as well as West, Southern and South Africa. Overall the regions with the most growth during the 7 month period was Australia and New Zealand, South America, and Central America.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th colspan="5"&gt;Number of Sites Included in CrUX dataset&lt;/th&gt;
&lt;/tr&gt;&lt;/thead&gt;
&lt;thead&gt;&lt;tr&gt;
&lt;th&gt;Sub Region&lt;/th&gt;
&lt;th&gt;Dec 2019&lt;/th&gt;
&lt;th&gt;Jan 2020&lt;/th&gt;
&lt;th&gt;May 2020&lt;/th&gt;
&lt;th&gt;June 2020&lt;/th&gt;
&lt;th&gt;August 2020&lt;/th&gt;
&lt;/tr&gt;&lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
&lt;td&gt;Central America&lt;/td&gt;
&lt;td&gt;155,057&lt;/td&gt;
&lt;td&gt;179,295&lt;/td&gt;
&lt;td&gt;236,255&lt;/td&gt;
&lt;td&gt;242,132&lt;/td&gt;
&lt;td&gt;257,043&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Australia and New Zealand&lt;/td&gt;
&lt;td&gt;124,763&lt;/td&gt;
&lt;td&gt;141,523&lt;/td&gt;
&lt;td&gt;194,212&lt;/td&gt;
&lt;td&gt;196,841&lt;/td&gt;
&lt;td&gt;214,757&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Northern Africa&lt;/td&gt;
&lt;td&gt;68,754&lt;/td&gt;
&lt;td&gt;69,497&lt;/td&gt;
&lt;td&gt;83,312&lt;/td&gt;
&lt;td&gt;88,672&lt;/td&gt;
&lt;td&gt;88,606&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Southern Africa&lt;/td&gt;
&lt;td&gt;50,618&lt;/td&gt;
&lt;td&gt;59,139&lt;/td&gt;
&lt;td&gt;64,978&lt;/td&gt;
&lt;td&gt;66,392&lt;/td&gt;
&lt;td&gt;70,218&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Central Asia&lt;/td&gt;
&lt;td&gt;45,932&lt;/td&gt;
&lt;td&gt;49,192&lt;/td&gt;
&lt;td&gt;57,098&lt;/td&gt;
&lt;td&gt;57,508&lt;/td&gt;
&lt;td&gt;62,112&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Western Africa&lt;/td&gt;
&lt;td&gt;44,692&lt;/td&gt;
&lt;td&gt;49,868&lt;/td&gt;
&lt;td&gt;47,834&lt;/td&gt;
&lt;td&gt;51,257&lt;/td&gt;
&lt;td&gt;50,853&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Caribbean&lt;/td&gt;
&lt;td&gt;33,840&lt;/td&gt;
&lt;td&gt;37,445&lt;/td&gt;
&lt;td&gt;44,090&lt;/td&gt;
&lt;td&gt;45,910&lt;/td&gt;
&lt;td&gt;45,395&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Eastern Africa&lt;/td&gt;
&lt;td&gt;31,010&lt;/td&gt;
&lt;td&gt;34,822&lt;/td&gt;
&lt;td&gt;36,073&lt;/td&gt;
&lt;td&gt;37,388&lt;/td&gt;
&lt;td&gt;38,609&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Middle Africa&lt;/td&gt;
&lt;td&gt;8,873&lt;/td&gt;
&lt;td&gt;9,149&lt;/td&gt;
&lt;td&gt;9,121&lt;/td&gt;
&lt;td&gt;10,057&lt;/td&gt;
&lt;td&gt;10,032&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Melanesia&lt;/td&gt;
&lt;td&gt;2,733&lt;/td&gt;
&lt;td&gt;2,991&lt;/td&gt;
&lt;td&gt;2,580&lt;/td&gt;
&lt;td&gt;2,779&lt;/td&gt;
&lt;td&gt;2,818&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th colspan="5"&gt;Percent Change of Sites Included in CrUX dataset&lt;/th&gt;
&lt;/tr&gt;&lt;/thead&gt;
&lt;thead&gt;&lt;tr&gt;
&lt;th&gt;Sub Region&lt;/th&gt;
&lt;th&gt;Dec 2019 - Jan 2020&lt;/th&gt;
&lt;th&gt;May - Jun 2020&lt;/th&gt;
&lt;th&gt;Jun - Aug 2020&lt;/th&gt;
&lt;th&gt;Dec - Aug 2020&lt;/th&gt;
&lt;/tr&gt;&lt;/thead&gt;
&lt;tbody&gt;
 &lt;tr&gt;
&lt;td&gt;Central America&lt;/td&gt;
&lt;td&gt;13.52%&lt;/td&gt;
&lt;td&gt;2.43%&lt;/td&gt;
&lt;td&gt;5.80%&lt;/td&gt;
&lt;td&gt;39.68%&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Australia and New Zealand&lt;/td&gt;
&lt;td&gt;11.84%&lt;/td&gt;
&lt;td&gt;1.34%&lt;/td&gt;
&lt;td&gt;8.34%&lt;/td&gt;
&lt;td&gt;41.91%&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Northern Africa&lt;/td&gt;
&lt;td&gt;1.07%&lt;/td&gt;
&lt;td&gt;6.04%&lt;/td&gt;
&lt;td&gt;-0.07%&lt;/td&gt;
&lt;td&gt;22.40%&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Southern Africa&lt;/td&gt;
&lt;td&gt;14.41%&lt;/td&gt;
&lt;td&gt;2.13%&lt;/td&gt;
&lt;td&gt;5.45%&lt;/td&gt;
&lt;td&gt;27.91%&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Central Asia&lt;/td&gt;
&lt;td&gt;6.63%&lt;/td&gt;
&lt;td&gt;0.71%&lt;/td&gt;
&lt;td&gt;7.41%&lt;/td&gt;
&lt;td&gt;26.05%&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Western Africa&lt;/td&gt;
&lt;td&gt;10.38%&lt;/td&gt;
&lt;td&gt;6.68%&lt;/td&gt;
&lt;td&gt;-0.79%&lt;/td&gt;
&lt;td&gt;12.12%&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Caribbean&lt;/td&gt;
&lt;td&gt;9.63%&lt;/td&gt;
&lt;td&gt;3.96%&lt;/td&gt;
&lt;td&gt;-1.13%&lt;/td&gt;
&lt;td&gt;25.45%&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Eastern Africa&lt;/td&gt;
&lt;td&gt;10.95%&lt;/td&gt;
&lt;td&gt;3.52%&lt;/td&gt;
&lt;td&gt;3.16%&lt;/td&gt;
&lt;td&gt;19.68%&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Middle Africa&lt;/td&gt;
&lt;td&gt;3.02%&lt;/td&gt;
&lt;td&gt;9.31%&lt;/td&gt;
&lt;td&gt;-0.25%&lt;/td&gt;
&lt;td&gt;11.55%&lt;/td&gt;
&lt;/tr&gt;
 &lt;tr&gt;
&lt;td&gt;Melanesia&lt;/td&gt;
&lt;td&gt;8.63%&lt;/td&gt;
&lt;td&gt;7.16%&lt;/td&gt;
&lt;td&gt;1.38%&lt;/td&gt;
&lt;td&gt;3.02%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Many of the regions that had an increase in sites visited (based on CrUX data), also have a high percentage of mobile visitors compared to the global population (based on statcounter).  So while it’s difficult to say for certain, it’s entirely possible that location is a large factor in the gap between Desktop and Mobile.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Analyzing by Top Level Domain&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The .com top level domain accounts for 43.7% of all websites tracked in the Chrome User Experience report. The next largest top level domain is .org, which consists of 3.7% of all sites. Overall there were 4111 TLDs in the dataset, and the top 20 of them represented 75% of all websites.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Fgrowth-of-the-web-in-2020%2Fimage7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Fgrowth-of-the-web-in-2020%2Fimage7.jpg" alt="Distribution of Websites by TLD - Chrome User Experience Report"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Most of these top level domains experienced a &amp;gt; 20% growth in active websites since December 2019, with the exception of .info and .net. The domains with the largest percentage growth were co.uk, com.au and de.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Fgrowth-of-the-web-in-2020%2Fimage8.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Fgrowth-of-the-web-in-2020%2Fimage8.jpg" alt="% Growth in Websites by TLD - December 2019 - August 2020"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we look at the month to month growth trends for these TLDs, we can make a few interesting observations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;There was a significant drop across all TLDs in March 2020.
&lt;/li&gt;
&lt;li&gt;The largest percentage drop was for .it domains in March 2020, although that rebounded with increases in April, May and June.&lt;/li&gt;
&lt;li&gt;In February 2020, there was a 23.9% increase in .edu domains receiving traffic. &lt;/li&gt;
&lt;li&gt;In May 2020, more than a dozen popular TLDs saw a double-digit increase in the number of sites. &lt;/li&gt;
&lt;li&gt;In August 2020 there was a 10.4% increase in edu domains&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Fgrowth-of-the-web-in-2020%2Fimage9.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaulcalvano.com%2Fassets%2Fimg%2Fblog%2Fgrowth-of-the-web-in-2020%2Fimage9.jpg" alt="Month/Month % Growth of Websites in CrUX"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The web is constantly growing and evolving, and clearly it’s rate of growth can vary quite a bit. During this analysis we explored a public dataset that Google provides to show how the web has grown during 2020, and which regions are growing the most.  While this doesn’t speak to the traffic levels experienced in these locations, the number of websites can be used as a proxy for understanding usage of the web. As this analysis shows, 2020 has been a year of substantial global growth for the web.&lt;/p&gt;

&lt;p&gt;If you are interested in seeing some of the SQL queries and raw data used in this analysis, I’ve created a post with all the details in the &lt;a href="https://discuss.httparchive.org/t/growth-of-the-web-in-2020/2029" rel="noopener noreferrer"&gt;HTTP Archive discussion forums&lt;/a&gt;. You can also see all the data used for these graphs in this &lt;a href="https://docs.google.com/spreadsheets/d/1eGfT0dBslpSl8Xl6ey7a_fNT0Cj5tTfJzX6gpwpXDBE/edit?usp=sharing" rel="noopener noreferrer"&gt;Google Sheet&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally posted at &lt;a href="https://paulcalvano.com/2020-09-29-growth-of-the-web-in-2020/" rel="noopener noreferrer"&gt;paulcalvano.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webperf</category>
      <category>web</category>
      <category>httparchive</category>
    </item>
    <item>
      <title>Browser Back/Forward Caches and their Benefit to Web Performance</title>
      <dc:creator>Paul Calvano</dc:creator>
      <pubDate>Mon, 03 Aug 2020 18:52:58 +0000</pubDate>
      <link>https://forem.com/paulcalvano/browser-back-forward-caches-and-their-benefit-to-web-performance-4f4l</link>
      <guid>https://forem.com/paulcalvano/browser-back-forward-caches-and-their-benefit-to-web-performance-4f4l</guid>
      <description>&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are a few different types of top-level navigation events that browsers handle. The most common one is a simple “navigation”. You enter a URL in the address bar and hit enter, or you click on a hyperlink to visit another webpage. Another is a “reload”, which causes the browser to revalidate it’s cached entries. There’s also a “hard reload”, where the browser ignores cache and reloads the page. And another type of navigation, which we will discuss in this post, is “Back/Forward” navigation. These occur when you click the back or forward buttons in your browser to return to a previously visited page.&lt;/p&gt;

&lt;p&gt;If you are using a real user measurement (RUM) service like&lt;a href="https://www.akamai.com/us/en/products/performance/mpulse-real-user-monitoring.jsp"&gt; mPulse&lt;/a&gt; then you are likely collecting the stats for every navigation type that results in a page load. The&lt;a href="https://www.w3.org/TR/navigation-timing/"&gt; navigation timing API&lt;/a&gt; used by RUM services also includes the&lt;a href="https://www.w3.org/TR/navigation-timing/#sec-navigation-info-interface"&gt; navigation type&lt;/a&gt; which makes it possible to determine which one was used. You can see the value in your browser console by checking the value of &lt;code&gt;performance.navigation.type&lt;/code&gt;. The values defined by the specification are below:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tr&gt;
   &lt;td&gt;Navigation Event
   &lt;/td&gt;
   &lt;td&gt;Type Attribute
   &lt;/td&gt;
   &lt;td&gt;Description
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;TYPE_NAVIGATE
   &lt;/td&gt;
   &lt;td&gt;0
   &lt;/td&gt;
   &lt;td&gt;Navigation started by clicking a link, entering a URL in the address bar, submitting a form, or triggered by a script (except the ones used by reload or back_forward)
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;TYPE_RELOAD
   &lt;/td&gt;
   &lt;td&gt;1
   &lt;/td&gt;
   &lt;td&gt;Navigation through the reload operation or the `location.reload()` method.
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;TYPE_BACK_FORWARD
   &lt;/td&gt;
   &lt;td&gt;2
   &lt;/td&gt;
   &lt;td&gt;Navigation through a history traversal operation.
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;TYPE_RESERVED
   &lt;/td&gt;
   &lt;td&gt;255
   &lt;/td&gt;
   &lt;td&gt;Any navigation types not defined above.
   &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;mPulse collects the navigation types for every real user measurement across thousands of websites. Analyzing this data can provide an interesting perspective on the performance of back/forward navigations as well as how their usage varies by device and browser. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Back/Forward Caches in Popular Browsers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The general idea behind a back/forward cache is to preserve the state of the page so that the DOM does not need to be rebuilt when a user returns to a previously visited page. With a back/forward cache the render tree and layout remains intact. The page is not technically loaded again because it was already loaded.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.chromestatus.com/feature/5815270035685376"&gt;Chrome&lt;/a&gt;,&lt;a href="https://developer.mozilla.org/en-US/docs/Archive/Misc_top_level/Working_with_BFCache"&gt; Firefox&lt;/a&gt; and&lt;a href="https://webkit.org/blog/427/webkit-page-cache-i-the-basics/"&gt; Safari&lt;/a&gt; all have implementations of a back/forward cache, although Chrome’s is currently hidden behind an experimental flag (chrome://flags/#back-forward-cache). &lt;/p&gt;

&lt;p&gt;The Chrome team has announced its intention to enable the back/forward cache feature for Chrome Mobile users&lt;a href="https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/S9qRFx4ozXk/DNT8tiR3BAAJ"&gt; starting with Chrome 86 (October 2020)&lt;/a&gt;. In this post we will examine how frequently back/forward navigations are used across different devices and browsers. We’ll also look at the performance opportunities that the back/forward cache implementation may be able to solve.&lt;/p&gt;

&lt;p&gt;_Note: Because of how back/forward caches work, we do not have real user measurements for back/forward cache hits. In this analysis we’ll explore the opportunity presented by back/forward caches, and not the performance gained by any specific browser’s implementation. _&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summary of Navigation Types&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The graph below illustrates the breakdown of different navigation types by device type. While the content of this graph is very high level and seems to be simple, it’s important to note that this is an aggregation of tens of billions of real user measurements from thousands of websites, measured during the month of June 2020.&lt;/p&gt;

&lt;p&gt;There are a few interesting observations we can make from this graph:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Across all device types, ~85% of navigations are type=navigation.
&lt;/li&gt;
&lt;li&gt;  There is a greater percentage of back/forward navigations on mobile and tablet devices compared to desktop&lt;/li&gt;
&lt;li&gt;  Desktop browsers had 60% more reloads compared to mobile/tablet. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ygf6j4k7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paulcalvano.com/assets/img/blog/browser-backforward-caches-and-their-benefit-to-web-performance/image1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ygf6j4k7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paulcalvano.com/assets/img/blog/browser-backforward-caches-and-their-benefit-to-web-performance/image1.jpg" alt="Navigation Types by Device Type"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Desktop Browsers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The most popular desktop browsers are Chrome, Safari, Edge and Firefox.   In fact, combined they account for 91.4% of all Desktop pages!&lt;/p&gt;

&lt;p&gt;_Note: When looking at this data it’s also important to note that in Firefox and Safari we only have the back/forward navigation events for navigations that did not result in a back/forward cache hit. _ &lt;/p&gt;

&lt;p&gt;When we look at this by desktop browser, we can see that&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Chrome and Opera have a large % of reloads compared to other browsers&lt;/li&gt;
&lt;li&gt;  Almost 17% of Opera navigations are back/forward!&lt;/li&gt;
&lt;li&gt;  All browsers except for Safari Desktop and legacy IE have at least 10% of back/forward navigations.&lt;/li&gt;
&lt;li&gt;  There were 50% less back/forward navigations measured for Safari compared to Chrome. This seems to indicate that approximately half the time users are getting a cache hit from this feature.&lt;/li&gt;
&lt;li&gt;  Firefox had a similar rate of back/forward navigations to Chrome. This seems to indicate that either Back/Forward navigation are much more prevalent in Firefox, or that their implementation is not resulting in many cache hits.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Iuza_u6w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paulcalvano.com/assets/img/blog/browser-backforward-caches-and-their-benefit-to-web-performance/image2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Iuza_u6w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paulcalvano.com/assets/img/blog/browser-backforward-caches-and-their-benefit-to-web-performance/image2.jpg" alt="Navigation Types by Desktop Browser"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The graph below illustrates the median load times by navigation types for these browsers. For each browser, the reload events are significantly slower. On Chrome, reloads took 30% longer than navigations. Firefox saw the biggest degradations with reload events, taking almost twice as long as navigations.&lt;/p&gt;

&lt;p&gt;Comparing the navigation and back/forward load times, we can see that legacy IE and Opera back/forward load times were only slightly faster than a navigation. With Chrome, the back/forward navigations are 16% faster than navigations. Safari back/forward navigations are 27% faster. That’s without any back/forward cache, but merely relying on the efficiency of the browser cache.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Gtdg-o90--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paulcalvano.com/assets/img/blog/browser-backforward-caches-and-their-benefit-to-web-performance/image3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Gtdg-o90--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paulcalvano.com/assets/img/blog/browser-backforward-caches-and-their-benefit-to-web-performance/image3.jpg" alt="Load Times per Desktop Navigation Types"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mobile Browsers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The most popular mobile browsers are Mobile Safari and Chrome Mobile, which together accounts for 67.6% of mobile page views. The graph below also includes other popular mobile browsers such as Samsung Internet, UC Browser, Crosswalk, and Firefox Mobile.   Additionally included are webviews and in-app browsers are included - such as Facebook, Instagram, LINE, Flipboard, Snapchat, Pinterest, etc.&lt;/p&gt;

&lt;p&gt;Some observations: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Back/Forward usage is much more prominent in mobile browsers compared to desktop browsers.&lt;/li&gt;
&lt;li&gt;  Mobile browsers have a much higher back/forward usage compared to WebViews and in-app browsers.&lt;/li&gt;
&lt;li&gt;  Considering the difference between Chrome Mobile iOS vs Mobile Safari (both Wekbit based), as well as Chrome Mobile vs Samsung Internet vs Crosswalk (all Chromium based), the amount of back/forward navigation events may be influenced by the browser UI.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fCfIpxEe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paulcalvano.com/assets/img/blog/browser-backforward-caches-and-their-benefit-to-web-performance/image4.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fCfIpxEe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paulcalvano.com/assets/img/blog/browser-backforward-caches-and-their-benefit-to-web-performance/image4.jpg" alt="Navigation Types by Mobile Browser"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is this a Blind Spot for Synthetic?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When measuring the performance of a synthetic transaction, you are usually starting a new session - which means that the page loads will be navigations.  Since most synthetic services identify themselves in their User-Agent, we’re able to compare navigation types across popular synthetic solutions using mPulse data. In the graph below you can see that the vast majority of requests from synthetic services are navigation events. There are a small percentage of reloads, likely due to multi-step scripts that repeat a page view. The only synthetic measurement service that I was able to see back/forward navigations from was PingdomBot.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZKkoZGDB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paulcalvano.com/assets/img/blog/browser-backforward-caches-and-their-benefit-to-web-performance/image5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZKkoZGDB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paulcalvano.com/assets/img/blog/browser-backforward-caches-and-their-benefit-to-web-performance/image5.jpg" alt="Navigation Types by Desktop Synthetic"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Regardless of what we see today, on the measurement platform you use it may be possible to script these types of navigations. For example, in&lt;a href="https://webpagetest.org/"&gt; WebPageTest&lt;/a&gt; I can trigger a back/forward navigation by&lt;a href="https://sites.google.com/a/webpagetest.org/docs/using-webpagetest/scripting"&gt; using a script&lt;/a&gt;&lt;span&gt; &lt;/span&gt;such the one below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Turn off logging of results
logData 0   
// Navigate to the first page.  Then navigate to another page.
navigate    https://www.google.com/
navigate    https://www.google.com/search?q=back+forward+cache
// Wait for 2 seconds
sleep   2 
// Turn on logging of results
logData 1 
// Use JavaScript to trigger the back button
execAndWait window.history.back();
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What does this mean for RUM?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Many RUM implementations, such as mPulse, will aggregate and report on all user navigations.  So the results that you are looking at will include a mix of navigation, reload, back/forward and reserved navigation.   Based on the data here, ~ 10% of Desktop and ~20% of Mobile page loads utilize Back/Forward navigation. &lt;/p&gt;

&lt;p&gt;If a navigation is served from the Back/Forward cache, then it will not trigger a beacon since the browser is unfreezing the browser state.  In this case there will be no load event to trigger a beacon.&lt;/p&gt;

&lt;p&gt;We may look at ways to support timing back/forward navigation from cache in the future - but for now, I would expect the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Once Back/Forward cache rolls out for a browser, you might see a drop in page loads from that browser (since those navigation types will no longer be reported)&lt;/li&gt;
&lt;li&gt;  Additionally, load times may appear to be slightly higher because some of the faster experiences (a back/forward navigation utilizing the browser cache) will no longer be reported. Essentially, these measurements will be affected by &lt;a href="https://en.wikipedia.org/wiki/Selection_bias#Attrition"&gt;survivorship bias.&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I would expect this to apply to other analytics tools as well.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While we often think of navigating the web as the simple operation of loading a web page, there are different types of navigation events which can be measured.  Reloads are slower, and many of us are accustomed to that in normal use. However we expect the Back/Forward operations to be fast - and they are faster. The implementations of Back/Forward caches in popular browsers are helping to improve this experience even further - which has the benefit of significantly speeding up the web for up to 20% of navigations! &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally posted at &lt;a href="https://paulcalvano.com/2020-08-02-browser-backforward-caches-and-their-benefit-to-web-performance/"&gt;paulcalvano.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Many thanks to &lt;a href="https://twitter.com/nicj"&gt;Nic Jansma&lt;/a&gt; and &lt;a href="https://www.utkarshgoel.in/"&gt;Utkarsh Goel&lt;/a&gt; for reviewing this.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webperf</category>
      <category>browsers</category>
      <category>caching</category>
    </item>
    <item>
      <title>An Analysis of Cookie Sizes on the Web</title>
      <dc:creator>Paul Calvano</dc:creator>
      <pubDate>Mon, 13 Jul 2020 14:28:47 +0000</pubDate>
      <link>https://forem.com/httparchive/an-analysis-of-cookies-sizes-on-the-web-1mea</link>
      <guid>https://forem.com/httparchive/an-analysis-of-cookies-sizes-on-the-web-1mea</guid>
      <description>&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies"&gt;Cookies&lt;/a&gt; are used on a lot of websites - 83.9% of the 5.7 million home pages tracked in the&lt;a href="https://httparchive.org/"&gt; HTTP Archive&lt;/a&gt; to be specific. They are essentially a name/value pair set by a server and stored in a client’s browser. Sites can store these cookies by using the &lt;code&gt;Set-Cookie&lt;/code&gt; HTTP response header, or via JavaScript (&lt;code&gt;document.cookie&lt;/code&gt;). On subsequent requests, these cookies are sent to the server in a &lt;code&gt;Cookie&lt;/code&gt; HTTP request header. &lt;/p&gt;

&lt;p&gt;In this article we’ll be looking at the size of cookies across the web, and discuss some of the web performance implications of them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First vs Third Party cookies?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When a cookie is set by the domain you see in your address bar, it is considered a first party cookie. These can be used for session management, authentication, personalization, etc. When a cookie is set by a different domain, then it’s considered a third party cookie.&lt;/p&gt;

&lt;p&gt;Based on an analysis of over 109 million cookies, third parties account for 79% of all cookies.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bFiy0fAJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/635h6v978qjf1a3egup0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bFiy0fAJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/635h6v978qjf1a3egup0.png" alt="First vs Third Party Cookies"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: I wrote another blog post exploring the use of the SameSite attribute in cookie files, and how third party cookies are affected. You can read it&lt;a href="https://dev.to/httparchive/samesite-cookies-are-you-ready-5abd"&gt; here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cookie Sizes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An example of a cookie set by a server would be:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Set-Cookie: loggedIn=true; Domain=.example.com; Path=/; Max-Age=14400; HttpOnly&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Directives such as &lt;code&gt;Domain&lt;/code&gt;, &lt;code&gt;Path&lt;/code&gt;, &lt;code&gt;max-age&lt;/code&gt;, and &lt;code&gt;HttpOnly&lt;/code&gt; affect how the cookie is stored, and which hostname a browser should share them with. In this example, &lt;code&gt;loggedIn=true&lt;/code&gt; is the name/value portion of the cookie, and that is what we’ll be exploring in this post.&lt;/p&gt;

&lt;p&gt;The median length of all cookies in the HTTP Archive is 36 bytes as of June 2020. That statistic is consistent across both first and third party cookies. The minimum is just a single byte, usually set by empty Set-Cookie headers (which is likely an error).&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tr&gt;
   &lt;td&gt;Cookie Size&lt;/td&gt;
   &lt;td&gt;First Party&lt;/td&gt;
   &lt;td&gt;Third Party&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Min &lt;/td&gt;
   &lt;td&gt;1&lt;/td&gt;
   &lt;td&gt;1&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Median&lt;/td&gt;
   &lt;td&gt;36&lt;/td&gt;
   &lt;td&gt;37&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;95th Percentile&lt;/td&gt;
   &lt;td&gt;181&lt;/td&gt;
   &lt;td&gt;135&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;99th Percentile&lt;/td&gt;
   &lt;td&gt;287&lt;/td&gt;
   &lt;td&gt;248&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Max&lt;/td&gt;
   &lt;td&gt;29,735&lt;/td&gt;
   &lt;td&gt;8,500&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The largest cookie size was 29,735 bytes, which is quite large! This is so large in fact that it is rejected by all modern browsers. I was curious to see what the limits are, and decided to dig into the source. Both&lt;a href="https://source.chromium.org/chromium/chromium/src/+/master:net/cookies/parsed_cookie.h;l=24"&gt; Chrome&lt;/a&gt; and&lt;a href="https://dxr.mozilla.org/mozilla-central/source/netwerk/cookie/CookieCommons.h#57"&gt; Firefox&lt;/a&gt; will reject cookies greater than 4KB. This is likely due to the &lt;a href="https://tools.ietf.org/html/rfc6265#section-6.1"&gt;implementation limits defined in RFC 6265&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So who is setting these large cookies?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  The largest first party cookie was set by&lt;a href="https://www.ridewill.it/"&gt; https://www.ridewill.it/&lt;/a&gt;, and it is named menu. It’s value was a long urlencoded string that contained multiple &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; layers and links. All in all, there were 240 links in a single cookie!&lt;/li&gt;
&lt;li&gt;  Many large first party cookies included large session cookies.&lt;/li&gt;
&lt;li&gt;  The largest third party cookie was set by web.taggbox.com, and consisted of a large JSON array named “liveWall”. &lt;/li&gt;
&lt;li&gt;  Most of the largest third party cookies were set from web.taggbox.com as well as a small number of advertising third parties.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If we look at the entire distribution of cookie sizes, it gets even more interesting. 88% of the cookies being set are less than 100 bytes. The 99th percentile is 372 bytes. So really large individual cookies are not common.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9X9iKffY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/1nyyf4rkx48ubjbefzsq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9X9iKffY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/1nyyf4rkx48ubjbefzsq.png" alt="Distribution of Set-Cookie sizes"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cookies Sent to First Party Domain&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What about cookies that clients send back to servers? A client can send multiple cookies in a single &lt;code&gt;Cookie&lt;/code&gt; request header. Since the HTTP Archive only collects information on homepages, there is a limit to the insight we can collect here. If we look at just the request headers for favicon.ico, we can get an idea of how large the Cookie request header might be for a subsequent request. However this does not include any additional cookies set later in a session (ie, such as after logging in)&lt;/p&gt;

&lt;p&gt;The median size of cookies sent on the favicon request was 161 bytes and the 95th percentile was 681. The largest was 7,795 bytes, and you can see the distribution below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1LFUcyE6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zqx086gzefbflj091p9b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1LFUcyE6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zqx086gzefbflj091p9b.png" alt="Distribution of Request Cookie sizes"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It’s important to note that the cookies set by the time favicon was requested may under represent the size of the cookies users would send later in a browsing session. For example, when logging into an application, a few additional cookies might be set. Some third parties that use a first party subdomain (ie, if&lt;a href="http://www.example.com"&gt; www.example.com&lt;/a&gt; loaded a resource from metrics.example.com) also set a first party cookie.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Performance Implications of Large Cookies&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When a browser sends an HTTP request, the HTTP request headers are usually 400 - 500 bytes. In the example below the request headers total 407 bytes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET / HTTP/1.1
Host: www.example.com
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Adding a cookie to that will increase the size of the request header. If we add more than 1KB of cookies to that request, then we exceed 1500 bytes, which is the standard &lt;a href="https://en.wikipedia.org/wiki/Maximum_transmission_unit"&gt;maximum transmission unit (MTU)&lt;/a&gt; used by TCP. This means that the HTTP request would span multiple TCP packets, which may result in multiple round trips and increase the risk of retransmission. This can potentially increase the TTFB of the response since it would take longer to make the request.&lt;/p&gt;

&lt;p&gt;With HTTP/2, we have&lt;a href="https://tools.ietf.org/html/rfc7541"&gt; HPACK compression&lt;/a&gt; - which was designed to help reduce the size of HTTP request headers by utilizing a dynamic index table. Receiving endpoints &lt;a href="https://tools.ietf.org/html/rfc7540#section-6.5.2"&gt;advertise the maximum size of this table&lt;/a&gt; in bytes (default is 4096), the sender can insert headers up to this limit in one request or response and subsequently reference it in another. In theory HPACK seems like it could help reduce the overhead of these large cookies. However, it’s not as easy as it sounds. Consider the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; If a request is made on a new HTTP/2 connection (ie, for a return visitor, or a navigation that happened after the previous connection times out), then the entire cookie string would be sent. This would impact TTFB for that first request (usually the HTML).&lt;/li&gt;
&lt;li&gt; Some servers intentionally exclude cookies from HPACK compression, since cookies are a very valuable target for an attacker. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because of the practical constraints on compressing cookies, and the impact of cookie size on the first flight of requests and responses, it is beneficial to use smaller cookies. Based on the observations here, 900 bytes seems like a good budget for a total cookie size, which leaves room for other headers such as user-agent (which can benefit from HPACK compression).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Cookies are everywhere, and they are set by both first and third party requests. Most browsers will limit the size of cookies stored to 4KB - which is still quite large.  &lt;/p&gt;

&lt;p&gt;At a minimum, setting a cookie larger than 4KB will simply not work. However, 4KB is still too large and can negatively impact your TTFB by increasing the number of round trips on the HTTP response.&lt;/p&gt;

&lt;p&gt;Even moreso, it’s important to keep track of how many cookies are being sent, as bloated cookies can also impact your TTFB by increasing the time it takes to make an HTTP request.&lt;/p&gt;

&lt;p&gt;If you are interested in seeing some of the SQL queries and raw data used in this analysis, I’ve created a post with all the details in the &lt;a href="https://discuss.httparchive.org/t/analysis-of-cookie-size/1991"&gt;HTTP Archive discussion forums&lt;/a&gt;. You can also see all the data used for these graphs in &lt;a href="https://docs.google.com/spreadsheets/d/1pO3lUWc41jw43rtk8JCxZi3tGFBxEV__Q-K4DZ0lc_s/edit?usp=sharing"&gt;this Google Sheet&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Many thanks to &lt;a href="https://twitter.com/SimmerVigor"&gt;Lucas Pardue&lt;/a&gt; and &lt;a href="https://twitter.com/ringel"&gt;Matt Ringel&lt;/a&gt; for reviewing this.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>webperf</category>
      <category>cookies</category>
      <category>httparchive</category>
    </item>
    <item>
      <title>Investigating Duplicate HTML Requests on a Page Load </title>
      <dc:creator>Paul Calvano</dc:creator>
      <pubDate>Fri, 10 Jul 2020 21:44:30 +0000</pubDate>
      <link>https://forem.com/paulcalvano/investigating-duplicate-html-requests-on-a-page-load-2eog</link>
      <guid>https://forem.com/paulcalvano/investigating-duplicate-html-requests-on-a-page-load-2eog</guid>
      <description>&lt;p&gt;&lt;em&gt;&lt;strong&gt;Why it occurs, and what is the impact on web performance?&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;br&gt;
Ever see a web page load an embedded object that is really the same HTML as the main document? I’ve seen this show up on a handful of websites recently - including a few large ecommerce sites, a news site, a financial services site and a utility company’s website. Every time I've run into this, I've said I need to write a blog post about it. So, here's that post!&lt;/p&gt;

&lt;p&gt;Two of the most recent ones I’ve seen made the same mistake. Can you spot the error?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwdhhi62sbie03rzufmni.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwdhhi62sbie03rzufmni.png" alt="Incorrectly set background URL"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The body was styled with the CSS &lt;code&gt;background&lt;/code&gt; property, which is shorthand for &lt;code&gt;background-color&lt;/code&gt;, &lt;code&gt;background-url&lt;/code&gt;, and others (this is explained better &lt;a href="https://css-tricks.com/almanac/properties/b/background/" rel="noopener noreferrer"&gt;here&lt;/a&gt;). In this example, the developer probably wanted to use &lt;code&gt;background: none&lt;/code&gt; to give a blank background color, but used an empty URL instead. The &lt;code&gt;url()&lt;/code&gt; function attempts to load a background image, and it takes a string as an argument. Since an empty string is a valid string this doesn’t trigger an error in the console. It simply results in a relative request to the base URL.&lt;/p&gt;

&lt;p&gt;I created a simple test page to demonstrate this. In the WebPageTest waterfall below you can clearly see the extra page request.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqjgfidvz8xlaaz1mj8g3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqjgfidvz8xlaaz1mj8g3.png" alt="Duplicate HTML Example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In Chrome DevTools, you would see the duplicate request show up with an initiator of the main document. In the console there is no indication or an error. This may not be a technical error, but it certainly is unintentional and comes with a performance penalty.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpjnuayqmvwi9wgc7hbk6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpjnuayqmvwi9wgc7hbk6.png" alt="Using Chrome DevTools to find the initiator of duplicate HTML"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this article we are going to explore why this is a performance issue, how duplicate requests for HTML can be inadvertently triggered, and how you can avoid them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the Performance Impact?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For many sites, HTML pages are dynamically generated - which means that there is a backend cost associated with delivering the content. We often measure this by using the Time to First Byte metric, which tells us the time from when a request was made until the browser starts to receive a response. Often these pages are not cacheable either - so each request gets handled dynamically.&lt;/p&gt;

&lt;p&gt;The overall capacity of the application backend is usually driven by the its ability to process the workload volume it receives. And if you are accidentally sending twice the number of requests for a dynamically generated HTML page, your infrastructure could be working twice as hard for nothing. &lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If the backend is struggling to keep up with the load, then all pages will be affected. This has the potential to degrade time-to-first-byte for all pages.&lt;/li&gt;
&lt;li&gt;There are costs involved with scaling out capacity at the origin. Unnecessary HTML requests can skew capacity planning in this case.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Increased page weight is an additional reason.   Many of the examples below were used to generate placeholders or empty content. In these cases, the additional HTML could be unnecessarily increasing page weight.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Causes This?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here are a few reasons I’ve seen for duplicate HTML requests&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;&amp;lt;body style="background: url('')"&amp;gt;&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is the example I started off this post with. When you style an element with a background URL using &lt;code&gt;url()&lt;/code&gt;, any string is considered a value argument. Since &lt;code&gt;url(‘ ‘)&lt;/code&gt; is passed a valid string, it gets translated to a relative URL.  This triggers a duplicate request in Chrome as well as Firefox.  Safari ignores the empty url string&lt;/p&gt;

&lt;p&gt;This also applies to other elements that can be styled with a background URL.  For example, &lt;code&gt;&amp;lt;div style="background: url()"&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And it also happens with &lt;code&gt;url()&lt;/code&gt;, &lt;code&gt;url('')&lt;/code&gt; and &lt;code&gt;url(' ')&lt;/code&gt;! &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;Element src’s with ? or  #&lt;/code&gt;&lt;/strong&gt; &lt;br&gt;
For some elements, a src attribute of either “?” or “#” would get interpreted that as a blank relative URL.   For example &lt;code&gt;&amp;lt;img src=”#” /&amp;gt;&lt;/code&gt; looks like an empty placeholder image, but it will cause the base HTML to get fetched again.&lt;/p&gt;

&lt;p&gt;The same applies for &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;iframe&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;video&amp;gt;&lt;/code&gt; - although browsers vary a bit.  For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;src=” “&lt;/code&gt; returns a duplicate request for Firefox, but not the other browsers.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;script src=”#” /&amp;gt;&lt;/code&gt; also affects only Firefox&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;script src=”?” /&amp;gt;&lt;/code&gt; affects only Chrome browsers&lt;/li&gt;
&lt;li&gt;Chrome does not send duplicate requests for relative video src attributes, but Firefox and Safari do.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The table below lists the full summary of the tests I ran across Chrome, Safari and Firefox to see how they handle these errors.  A warning icon indicates that they result in multiple HTML requests - &lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Chrome&lt;/th&gt;
&lt;th&gt;Safari.&lt;/th&gt;
&lt;th&gt;Firefox&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;img src="#" /&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;img src=" " /&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;img src="?" /&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;script src="#" /&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;script src=" " /&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;script src="?" /&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;iframe src="#" /&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;iframe src=" " /&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;iframe src="?" /&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;video src="#" /&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;video src=" " /&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;video src="?" /&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;body style="background: url()"&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;body style="background: url('')"&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;body style="background: url(' ')"&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;div style="background: url()"&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;div style="background: url('')"&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;div style="background: url(' ')"&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F05xoj5meuc8fs27dzm7e.png" alt="Duplicate HTML"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;* iFrames with src=”?” and “#” resulted in 3-4 HTML requests for the same page.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;Service worker Cache&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Creating a separate cache layer via a service worker is a great way to preload your browser cache for resources that it will need later.   However, what happens when you include an HTML page as one of those resources to fetch? &lt;/p&gt;

&lt;p&gt;Here's an example of a site doing exactly that. Even worse, the HTML was not cacheable... &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2v2bf8yqoppw7cl31wcx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2v2bf8yqoppw7cl31wcx.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are going to use a service worker to cache a resource, make sure that resource is cacheable!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;display:none&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
While this example is not specifically about HTML, it occurs enough that it's worth mentioning.  As &lt;a class="mentioned-user" href="https://dev.to/dougsillars"&gt;@dougsillars&lt;/a&gt; says "display:none does not mean download:none".   &lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1261888005364756480-648" src="https://platform.twitter.com/embed/Tweet.html?id=1261888005364756480"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1261888005364756480-648');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1261888005364756480&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;In this example, the developer referenced video content that used a media query to hide the video for certain screen sizes. The end result was downloading both the desktop and mobile videos, while hiding one of them. That's a lot of wasted bytes!&lt;/p&gt;

&lt;p&gt;Why do I bring this up in an article about duplicate HTML requests?  I've seen some cases of this technique used alongside &lt;code&gt;&amp;lt;img src="#" /&amp;gt;&lt;/code&gt; - resulting in duplicate HTML!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to Detect?&lt;/strong&gt;&lt;br&gt;
There aren't any tools or audits I know of that look for this, as it does tend to be a bit of a niche error. &lt;/p&gt;

&lt;p&gt;Probably the easiest way to spot this is by looking at the CPU processing overlay in WebPageTest. If you see JS execution for a request before the request is loaded, then it was likely a duplicate.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3j50ktp615emy6a8uqkp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3j50ktp615emy6a8uqkp.png" alt="WebPageTest Example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In DevTools, you can also filter by your domain name using &lt;code&gt;domain:www.example.com&lt;/code&gt;. Filtering and sorting by name, makes these easier to spot. If you see the same URL with a type of both document and text/html, then you are loading a duplicate HTML page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fn1rw11zs3fgkepee6wj0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fn1rw11zs3fgkepee6wj0.png" alt="DevTools Example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Clicking on the initiator can help find what caused the duplicate HTML to load.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
If you are analyzing a page and see what looks like a duplicate request for the base HTML page, don’t ignore it!  This could be a serious performance and capacity issue. Instead use DevTools to attempt to locate what initiated that request. You may find that you have accidentally included a placeholder or set an incorrect CSS property or element src attribute. &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>webperf</category>
      <category>css</category>
      <category>html</category>
    </item>
    <item>
      <title>SameSite Cookies - Are you Ready?</title>
      <dc:creator>Paul Calvano</dc:creator>
      <pubDate>Tue, 07 Jul 2020 20:43:39 +0000</pubDate>
      <link>https://forem.com/httparchive/samesite-cookies-are-you-ready-5abd</link>
      <guid>https://forem.com/httparchive/samesite-cookies-are-you-ready-5abd</guid>
      <description>&lt;p&gt;Last year Google&lt;a href="https://blog.chromium.org/2019/05/improving-privacy-and-security-on-web.html"&gt; announced&lt;/a&gt; updates to Chrome that provide a way for developers to control how cross site cookies should work on their sites. This is a good change - as it ultimately improves end user security and privacy by limiting which third parties can read cookies that were set while visiting a different site. It also defeats &lt;a href="https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)"&gt;cross site request forgery attacks&lt;/a&gt;. The implementation is fairly simple, and only requires developers to add the SameSite attribute to their cookies. &lt;/p&gt;

&lt;p&gt;The SameSite attribute is &lt;a href="https://caniuse.com/#feat=same-site-cookie-attribute"&gt;supported by all modern browsers&lt;/a&gt;, and most have historically defaulted to a permissive use of cookies if the attribute isn’t present. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5_-GJ0ak--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gflnfrrax9xc44z8rxgb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5_-GJ0ak--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gflnfrrax9xc44z8rxgb.png" alt="SameSite Cookie Browser Support"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Google changed the default behavior of SameSite attribute to secure cookies by default when Chrome 80 was released in February 2020. However it was&lt;a href="https://blog.chromium.org/2020/05/resuming-samesite-cookie-changes-in-july.html"&gt; rolled back in April 2020&lt;/a&gt;&lt;span&gt; &lt;/span&gt;to ensure stability during the initial stage of the COVID-19 response. Now they are planning to&lt;a href="https://blog.chromium.org/2020/05/resuming-samesite-cookie-changes-in-july.html"&gt; resume SameSite cookie enforcement&lt;/a&gt; with Chrome 84, which will be released on July 14th. &lt;/p&gt;

&lt;p&gt;Despite almost a year of notice and warnings in the browser console, this seemed to catch many by surprise in February.  How ready are third parties for this now?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is a Cross Site Third Party Cookie?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If a request on &lt;a href="http://www.example.com"&gt;www.example.com&lt;/a&gt; sets the following cookie from its domain, then the browser will store this cookie and send it back on subsequent requests to the same domain. This is an example of a first party cookie. Essentially a cookie whose domain matches the domain that appears in the address bar...&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Set-Cookie: session=abc; path=/; Secure; HttpOnly;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now let’s assume that &lt;a href="http://www.example.com"&gt;www.example.com&lt;/a&gt; includes a third party analytics provider, metrics.analyticsexample.com. When the third party request is made, that third party can also set a cookie in the end users browser. And that third party will be able to read the cookie. This is an example of a third party cookie.&lt;/p&gt;

&lt;p&gt;If that same user then navigated to &lt;a href="http://www.example2.com"&gt;www.example2.com&lt;/a&gt;, which uses the same third party analytics provider, then their third party cookies would be readable by them across both sites. The third party is then able to track the user across multiple websites.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SameSite Cookies&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The SameSite cookie attribute was introduced in a &lt;a href="https://tools.ietf.org/html/draft-west-first-party-cookies-06"&gt;2016 IETF draft&lt;/a&gt;, but had not been widely adopted initially.  This attribute provided developers with the ability to control when a browser would send a cookie to a third party. Using them is simply a matter of adding the SameSite attribute to a cookie declaration, with one of the three supported values: “None”, “Lax”, and “Strict”.&lt;/p&gt;

&lt;p&gt;This provides the following controls:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  SameSite=None

&lt;ul&gt;
&lt;li&gt;  The browser will send cookies with both cross-site requests and same-site requests.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;  SameSite=Lax

&lt;ul&gt;
&lt;li&gt;  Same-site cookies are withheld on cross-site sub-requests, such as calls to load images or frames, but will be sent when a user navigates to the URL from an external site; for example, by following a link.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;  SameSite=Strict

&lt;ul&gt;
&lt;li&gt;  The browser will only send cookies for same-site requests (requests originating from the site that set the cookie). If the request originated from a different URL than the URL of the current location, none of the cookies tagged with the Strict attribute will be included.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;An example of how this is configured is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Set-Cookie: key=value; SameSite=Strict&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If the SameSite attribute is not included, then most browsers have historically defaulted to the most permissive behavior: SameSite=None.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Google Chrome’s Update&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Google has been planning to update the behavior of SameSite within the Chrome browser to default to the more secure SameSite=Lax. Additionally, if a SameSite=None attribute is present, then they would require that the cookie have the “Secure” attribute. There was some concern that this change would cause breakage for some third parties, so a warning message was included in Chrome since version 77 (September 2019).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A cookie associated with a cross-site resource at  was set without the &lt;code&gt;SameSite&lt;/code&gt; attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with &lt;code&gt;SameSite=None&lt;/code&gt; and &lt;code&gt;Secure&lt;/code&gt;. You can review cookies in developer tools under Application&amp;gt;Storage&amp;gt;Cookies and see more details at &lt;a href="https://www.chromestatus.com/feature/5088147346030592"&gt;https://www.chromestatus.com/feature/5088147346030592&lt;/a&gt; and&lt;a href="https://www.chromestatus.com/feature/5633521622188032"&gt; https://www.chromestatus.com/feature/5633521622188032&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;SameSite Usage Across the Web&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://httparchive.org/"&gt;HTTP Archive&lt;/a&gt; stores a tremendous amount of detail for every HTTP request and response for approximately 5.8 million homepages. In the June 2020 data, there were approximately 108 million third party cookies set across 3.79 million homepages. Of these cookies 35,721,768 (32.9%) included the SameSite attribute.  Comparatively in August 2019, 21.4% of cookies had the SameSite attribute.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yK40uYjg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/a1lrpyd2wp7irwpfhbjs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yK40uYjg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/a1lrpyd2wp7irwpfhbjs.png" alt="SameSite usage for third party cookies"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: Due to a collection issue described&lt;a href="https://discuss.httparchive.org/t/does-bigquery-contain-har-archive-or-cookies-of-crawled-webpages/1968/8"&gt; here&lt;/a&gt;, ~18.6% of third party cookies were unreadable in the June 2020 HTTP Archive data. The remainder of this analysis is on the cookies we could read.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The “Secure” flag of a cookie ensures that the browser only sends the cookie over HTTPS. Chrome made this a requirement to use SameSite=None. Out of the 35 million cookies, nearly 75% of them use the Secure flag. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iLttFAI0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/00imlj5llluyriyrzz2g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iLttFAI0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/00imlj5llluyriyrzz2g.png" alt="Table Breakdown of Secure vs Non-Secure Cookies and SameSite attribuets"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we look at this graphically, there are a few interesting observations we can make:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  SameSite=Lax, which will be the new default, is in use by only 10.82% of secure cookies, but 97% of insecure cookies.&lt;/li&gt;
&lt;li&gt;  SameSite=None is present on 89.10% of Secure cookies.&lt;/li&gt;
&lt;li&gt;  2.65% (238,810) insecure cookies are set with SameSite=None, but not including the Secure flag.  These will default to SameSite=Lax.&lt;/li&gt;
&lt;li&gt;  Only 0.06% (16,000) of secure cookies are using SameSite=Strict!&lt;/li&gt;
&lt;li&gt;  There are less than 1000 SameSite attributes set to an erroneous value (ie, not Lax, Strict or None).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Scwm9sMs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gvta0gbt9uemri927dff.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Scwm9sMs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gvta0gbt9uemri927dff.png" alt="SameSite Usage for Third Party Cookies, Secure and non-Secure"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Who is using SameSite=None incorrectly?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There were 238,810 third party cookies set with SameSite=None, but missing the Secure flag. These will default to SameSite=Lax in Chrome 84 unless the Secure flag is added. Overall, there were 1749 third party domains that made this error. The top 5 account for 48% of the erroneous SameSite cookies. This includes Spotxchange, ETargetNet, SmartAdServer, BazaarVoice and EntityTag. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wq0dJn2B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3ehsetnuxb2l828noj1a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wq0dJn2B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3ehsetnuxb2l828noj1a.png" alt="Cookies with SameSite=None, but not secure"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Even more concerning than the number of cookies, is the number of websites that are affected. For example spotxchange.com is setting SameSite=None with insecure cookies on 26,174 websites. EntityTag.co.uk is doing the same for 14,358 websites.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Who is using SameSite Strict?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I thought it was odd that SameSite=Strict was used so infrequently. The table below shows some of the third parties that are using it. The top 10 account for 67% of all SameSite=Strict usage.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yL3aoV6m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/p96dsxgsqdo99n11ylwq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yL3aoV6m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/p96dsxgsqdo99n11ylwq.png" alt="Cookies with SameSite=Strict"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Erroneous SameSite Attribute Values are in Use?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I was surprised to see that there was such a low percentage of erroneous usage of the SameSite attribute. The top 10 errors listed below account for 80% of the erroneous uses.  Most were SameSite=Secure, SameSite with no value, and SameSite: Lax. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--USlHWOs7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6i8n6hty9254t2hf8lh7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--USlHWOs7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6i8n6hty9254t2hf8lh7.png" alt="Erroneous SameSite Usage"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Many of these errors were from a small number of third parties. For example:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  SameSite=secure was set by wildbeardbg.com:

&lt;ul&gt;
&lt;li&gt;  dg_perm_sessid=95951591788161; secure; SameSite=Secure&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;  SameSite: Lax was set by nytimes.com.

&lt;ul&gt;
&lt;li&gt;  nyt-purr=cfshcfhssc; Expires=Fri, 18 Jun 2021 01:02:51 GMT; Path=/; Domain=.nytimes.com;SameSite: Lax;Secure&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;  SameSite=; was set by cloudengage.com

&lt;ul&gt;
&lt;li&gt;  CEUID=E80y%2BgcVMl0o6Skdol5X9FRCrdrbqBNssQeOYrNUnQxC42U4gpGNV6VX; expires=Wed, 01-Jul-2020 16:16:13 GMT; Max-Age=2592000; path=/; samesite=; domain=.cloudengage.com; secure; HttpOnly
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;SameSite Usage Across Popular Third Parties&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So far we’ve looked at how SameSite is being used across third parties. But which third parties are not setting SameSite attributes? By not setting it, they will default to SameSite=Lax. Whether or not this is intentional or will cause breakage will depend on each third party's usage of the cookies. But not setting an explicit SameSite attribute could be indicative of whether a third party has prepared for this.&lt;/p&gt;

&lt;p&gt;The graph below shows SameSite usage across some of the most popular third parties. Very few sites third parties are setting SameSite=Lax, which is about to become the new default.  Some of these third parties are used by hundreds of thousands of sites. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YJR1vfLW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zofi46l9kj16ojfc8g3n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YJR1vfLW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zofi46l9kj16ojfc8g3n.png" alt="SameSite Usage Across Popular Third Parties"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;SameSite cookies are a huge win for privacy and security, but there is a risk that Chrome’s new default settings will cause problems. For many cases, this will likely render some cross site tracking techniques ineffective with little change to end user experience. However, with any changes like this there are risks of breakage and serious site issues. With SameSite adoption at less than 33% of third party cookies, this raises the question of how prepared third parties are for this.&lt;/p&gt;

&lt;p&gt;It’s important to note that the absence of a SameSite attribute does not necessarily mean that there will be breakage. However depending on how the cookie is used, it has the potential of becoming problematic. It may be worth checking the JS console in Chrome DevTools to see if you see the SameSite warning for any of your third parties. You can also set a flag in Chrome to test how this will affect your site ahead of the Chrome 84 release. The Chrome team has published a &lt;a href="https://www.chromium.org/updates/same-site/test-debug"&gt;useful guide for debugging SameSite cookies&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you are interested in seeing some of the SQL queries and raw data used in this analysis, I’ve created a post with all the details in the &lt;a href="https://discuss.httparchive.org/t/samesite-cookies-analysis/1988"&gt;HTTP Archive discussion forums&lt;/a&gt;. You can also see all the data used for these graphs in &lt;a href="https://docs.google.com/spreadsheets/d/1-zx1AmcvDDSKjOLsM3-AbV9qVXV-Of6dmps8LG-oMSk/edit?usp=sharing"&gt;this Google Sheet&lt;/a&gt;. &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>httparchive</category>
      <category>cookies</category>
      <category>webtransparency</category>
    </item>
    <item>
      <title>Certificate Validity Dates</title>
      <dc:creator>Paul Calvano</dc:creator>
      <pubDate>Thu, 20 Feb 2020 20:55:52 +0000</pubDate>
      <link>https://forem.com/httparchive/certificate-validity-dates-1d50</link>
      <guid>https://forem.com/httparchive/certificate-validity-dates-1d50</guid>
      <description>&lt;p&gt;Back in 2017 the maximum validity lifetime for an HTTPS certificate was &lt;a href="https://cabforum.org/2017/03/17/ballot-193-825-day-certificate-lifetimes/"&gt;set to 825 days&lt;/a&gt;, a decision that was widely supported by both browsers and certificate authorities. However, since then there have been multiple unsuccessful attempts at reducing the maximum lifetime to one year. &lt;a href="https://twitter.com/Scott_Helme"&gt;Scott Helme&lt;/a&gt; has &lt;a href="https://scotthelme.co.uk/ballot-sc22-reduce-certificate-lifetimes/"&gt;written about this previously&lt;/a&gt;, and his blog post noted that browser vendors unanimously supported this while some certificate authorities objected to it.&lt;/p&gt;

&lt;p&gt;Information is still trickling in, but it seems that Safari is planning to enforce a max validity lifetime of 398 days effective September 1st, 2020.&lt;/p&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--HNThWLvv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1102690863233359875/dF-wxPzS_normal.png" alt="Dean Coclin profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        Dean Coclin
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        @chosensecurity
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P4t6ys1m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      Today's big news: One year max public TLS certs are coming, starting 1 Sept 2020, if you want to be trusted in Safari.
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      22:10 PM - 19 Feb 2020
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1230253348236013570" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-reply-action.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1230253348236013570" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-retweet-action.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      103
      &lt;a href="https://twitter.com/intent/like?tweet_id=1230253348236013570" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-like-action.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
      149
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;p&gt;Let’s take a look at the state of certificate validity ranges today, so we can track how this evolves over the next few months. The data for this comes from the &lt;a href="https://httparchive.org"&gt;HTTP Archive&lt;/a&gt;, which is an open source project that tracks how the web is built. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Certificate Validity Dates in the Wild&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The HTTP Archive requests table contains certificate details for every HTTPS request that was served to the 5.3 million websites tracked. The details are in the &lt;code&gt;$._securityDetails&lt;/code&gt; and the data contains information on 4,397,690 unique hosts. Out of all of these, 136,007 hostnames served a validity date greater than 825 days! That’s 3.09% of all requests!&lt;/p&gt;

&lt;p&gt;Certificate validity dates are widely distributed, but there seems to be a few popular ranges. THe most common validity date is 90 days, likely to the popularity of LetsEncrypt Overall 55% of certificates have a validity date of less than 364 days, which I’ve highlighted in green below. An additional 20% of certificates have a validity between 365 and 398 days, which will meet Safari’s requirements. The remaining 25% have a validity range of more than 398 days.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4Qx8Dpj9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh6.googleusercontent.com/AOBjFo3j8o70P2yGzR0HGLyJ28q1MxwwsLCW3HkDU9_5lCdxPLyRjioJfnKCHGr4sgLQNTS9MDJwQxKb9kcQtDBztwXX1CpIjdvrP_K3fHsKr-3KOeukfoMaWSbmKWll1fkBMM2E" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4Qx8Dpj9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh6.googleusercontent.com/AOBjFo3j8o70P2yGzR0HGLyJ28q1MxwwsLCW3HkDU9_5lCdxPLyRjioJfnKCHGr4sgLQNTS9MDJwQxKb9kcQtDBztwXX1CpIjdvrP_K3fHsKr-3KOeukfoMaWSbmKWll1fkBMM2E" alt="|624x181"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looking at this by certificate authority is also quite interesting. The graph below shows the top 15 certificate authorities. LetsEncrypt accounts for 38.4% of all certificates -&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5ICX-g5c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh6.googleusercontent.com/tmVhJjeDtjJatp4JQ2G030Xqy4zar5WP3oOq-oXmSNau8yg1uUJLXMpNwTntspj_9myJGGYZ0pwe96YYS47aZBP99TQl7Y00m1WC-YHlOnGIw0BvbMEPjCpnEkFCMBtq5nRQ3xiF" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5ICX-g5c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh6.googleusercontent.com/tmVhJjeDtjJatp4JQ2G030Xqy4zar5WP3oOq-oXmSNau8yg1uUJLXMpNwTntspj_9myJGGYZ0pwe96YYS47aZBP99TQl7Y00m1WC-YHlOnGIw0BvbMEPjCpnEkFCMBtq5nRQ3xiF" alt="|624x227"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we look at certificate validity date ranges for these certificate authorities, we can see that there’s a mix. Certificates issued by LetsEncrypt, Cloudflare, cPanel and Amazon meet the 398 day requirement already. However, Sectigo, GoDaddy, DigiCert, Comodo and RapidSSL have a very large percentage of certificates that exceed 398 days. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6QK_y5AH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh6.googleusercontent.com/tNsRLp4kNsUJ55xIHvynO_7-pxNKooBth07BFajaVIODH1vZvlvswd_gA72N3rAvj8Ke4Z_DxW6ogi7Sworl4V8SRN0e4MePBE5xsV_nvC8fho0dyKM96GBgh_9R7puv5KE_j0up" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6QK_y5AH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh6.googleusercontent.com/tNsRLp4kNsUJ55xIHvynO_7-pxNKooBth07BFajaVIODH1vZvlvswd_gA72N3rAvj8Ke4Z_DxW6ogi7Sworl4V8SRN0e4MePBE5xsV_nvC8fho0dyKM96GBgh_9R7puv5KE_j0up" alt="|624x284"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.digicert.com/position-on-1-year-certificates/"&gt;DigiCert released a public statement&lt;/a&gt; yesterday, which confirms that existing certificates with a validity range &amp;gt;398 days will continue to be trusted by Safari, but that certificates issued after August 30th won’t be able to exceed 398 days.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;For your website to be trusted by Safari, you will no longer be able to issue publicly trusted TLS certificates with validities longer than 398 days after Aug. 30, 2020. Any certificates issued before Sept. 1, 2020 will still be valid, regardless of the validity period (up to 825 days). Certificates that are not publicly trusted can still be recognized, up to a maximum validity of 825 days. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I’m interested in seeing how this will evolve in the coming months, especially once there are more formal announcements about this. If you would like to see the queries used for this analysis, I've detailed them in this &lt;a href="https://discuss.httparchive.org/t/certificate-validity-dates/1874"&gt;HTTP Archive discussion forum post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Many thanks to Scott Helme for reviewing this.&lt;/p&gt;

</description>
      <category>httparchive</category>
      <category>security</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
