• February 28, 2024

The most interesting facts from the web almanac

The Web Almanac is an annual comprehensive report on the web, which is based on verified data and is produced by the developers of HTTP Archive. Let’s see what interesting statistics on the web were collected in 2021.

HTML
CSS
JavaScript
Other interesting facts
HTML
Have you ever wondered why all pages start with the common tag? This element tells browsers to follow the HTML specification as closely as possible.

This year, 97.4% of the pages included , which is slightly higher than last year’s 96.8%. If you look at the last couple of years, the percentage of doctypes has steadily increased by half a percent every year.

In terms of popularity, HTML5, better known as , is still the most popular document type: 88.8% of mobile pages use it.

Popularity of document types according to the web almanac
The popularity of document types in 2021.
A source

Today, the average mobile page contains 27 kB of HTML, which is 2 kB more than last year. As for the desktop versions of the site, this figure is even higher and amounts to 29 kB.

The web almanac also tells about HTML elements. For example, 112 elements are currently defined and used (excluding SVG and MathML), and another 28 are considered obsolete or obsolete. At the same time, the average page in both the mobile and desktop versions consists of 31 different elements:

The number of different types of elements on the page

Another funny fact: it turned out that none of the analyzed sites uses . CSS
Interestingly, the introduction of CSS into JavaScript code has grown to 3%, which is 1% more than last year. Another fact is no less curious. Despite the fact that cascading style sheets are not the heaviest component of most pages, their weight increases every year. So, in 2021, the average web page loads about 70 kB of CSS, which is 7.9% more than in 2020. At the same time, the situation with the desktop is much worse than with the mobile versions of the site: CSS dimensions according to the web almanac
The size of the transfer of style sheets to the page.
A source Incredibly, this year’s record for the number of external stylesheets surpassed last year’s almost twice: 2,368 against 1,379 in 2020. Why not combine several files into one? One can only guess. During the research, a page was also found on which the total weight of images uploaded using CSS was as much as 314,386 kB, which is equal to a third of a gigabyte! JavaScript
To optimize the use of JavaScript in applications, it is necessary to understand which part of the JavaScript code is really required. Let’s find out how JavaScript bytes are distributed on a page: Loading JavaScript to a page The web almanac demonstrates that the average mobile page loads 427 kB of JavaScript, while the desktop page’s value grows to 463 kB. Compared to 2019, the growth in JavaScript usage was 18.4% for desktop and 18.9% for mobile devices. Over time, there is a tendency to use more JavaScript, which can slow down the rendering of the application due to the additional load on the CPU. According to Lighthouse, the average mobile page loads 155 kB of unused JavaScript. And in the 90th percentile, as much as 598 kB of JavaScript code is not used: Unused and shared JavaScript bytes on mobile pages In addition, JavaScript is rich in various libraries and frameworks, and this is how their popularity was distributed in 2021: Top JavaScript libraries and frameworks according to the Web Almanac
Using JavaScript libraries and frameworks
.
A source Other interesting facts from the web almanac
94% of sites use at least one third-party resource, the vast majority of such resources are from Google services.
If the YouTube widget is connected to the page, the median blocking time of the main stream is 1.6 seconds.
16% of pages use meaningless link names: “click here”, “read”, “more”, etc.
22% of sites come with HSTS (HTTP Strict Transport Security).
20% of sites do not have a definition of the lang attribute.
How to master frontend development in 2022: roadmap In total, 24 chapters have been published in the web almanac, which also affect HTTP, SEO, CMS, security, performance and much more. The link to the table of contents is for those who wish to delve into all the subtleties of the changes of the web in 2021.