{"id":6555,"date":"2021-10-17T12:02:17","date_gmt":"2021-10-17T10:02:17","guid":{"rendered":"http:\/\/blog.bart.sk\/en\/?p=6555"},"modified":"2022-11-24T14:13:26","modified_gmt":"2022-11-24T13:13:26","slug":"e-shop-speed-optimization-part-1-introduction-tools","status":"publish","type":"post","link":"https:\/\/blog.bart.sk\/en\/e-shop-speed-optimization-part-1-introduction-tools\/","title":{"rendered":"E-shop speed optimization &#8211; part 1 (introduction of tools)"},"content":{"rendered":"<h2><b>Introduction<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">What do Google, Walmart, Amazon, and AliExpress share? All four companies saw improved conversions, increased traffic and lower bounce rates after optimizing their site load. In addition to increasing the actual purchases on the web, the speed of the website also helps with search result placement. Content is still more important, but out of two content-similar sites, the page with better <\/span><a href=\"https:\/\/web.dev\/vitals\/\"><span style=\"font-weight: 400;\">Web Vitals <\/span><\/a><span style=\"font-weight: 400;\">will be ranked higher<\/span><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><a href=\"https:\/\/blog.bart.sk\/wp-content\/uploads\/2021\/10\/conversion.png\"><img loading=\"lazy\" decoding=\"async\" class=\"hoverZoomLink aligncenter wp-image-8102 size-full\" src=\"https:\/\/blog.bart.sk\/wp-content\/uploads\/2021\/10\/conversion.png\" alt=\"\" width=\"613\" height=\"390\" \/><\/a><\/p>\n<h2>Web Vitals<\/h2>\n<p><span style=\"font-weight: 400;\">Web Vitals are 3 metrics that Google uses to measure the speed and usability of\u00a0 websites.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><b>LCP (L<\/b><span style=\"font-weight: 400;\">argest <\/span><b>C<\/b><span style=\"font-weight: 400;\">ontentful <\/span><b>P<\/b><span style=\"font-weight: 400;\">aint) &#8211; How fast the largest content on the page loads (e.g. an image, a text).<\/span><\/li>\n<li style=\"font-weight: 400;\"><b>FID (F<\/b><span style=\"font-weight: 400;\">irst <\/span><b>I<\/b><span style=\"font-weight: 400;\">nput <\/span><b>D<\/b><span style=\"font-weight: 400;\">elay) &#8211; How late the action starts after user interaction (e.g. clicking on a link or a button).<\/span><\/li>\n<li style=\"font-weight: 400;\"><b>CLS (C<\/b><span style=\"font-weight: 400;\">umulative <\/span><b>L<\/b><span style=\"font-weight: 400;\">ayout <\/span><b>S<\/b><span style=\"font-weight: 400;\">hift) <\/span><b>&#8211;<\/b><span style=\"font-weight: 400;\"> Have you ever clicked on a different link than you wanted because an ad appeared at the top of the page and all the content moved down? This is the offset measured by the CLS metric. The value of the metric is relatively difficult to calculate, but the tools can point to problematic elements.<\/span><\/li>\n<\/ul>\n<figure id=\"attachment_8103\" aria-describedby=\"caption-attachment-8103\" style=\"width: 1077px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/blog.bart.sk\/wp-content\/uploads\/2021\/10\/speed.png\"><img loading=\"lazy\" decoding=\"async\" class=\"hoverZoomLink wp-image-8103 size-full\" src=\"https:\/\/blog.bart.sk\/wp-content\/uploads\/2021\/10\/speed.png\" alt=\"Ako m\u00f4\u017ee pom\u00f4c\u0165 zr\u00fdchlenie str\u00e1nky v zv\u00fd\u0161en\u00ed konverzie (https:\/\/www.thinkwithgoogle.com\/intl\/en-gb\/feature\/testmysite\/)\" width=\"1077\" height=\"231\" \/><\/a><figcaption id=\"caption-attachment-8103\" class=\"wp-caption-text\"><span style=\"font-weight: 400;\">How speeding up a page can help increase conversions (https:\/\/www.thinkwithgoogle.com\/intl\/en-gb\/feature\/testmysite\/)<\/span><\/figcaption><\/figure>\n<h2><b>Speed measuring tools<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Today, there is a relatively large number of speed measuring tools. In this section, we&#8217;ll introduce the most used ones. In addition to speed, some tools also measure other metrics, such as site usability or SEO.<\/span><\/p>\n<p><b>Think with Google<\/b><\/p>\n<p><span style=\"font-weight: 400;\">(<\/span><a href=\"https:\/\/www.thinkwithgoogle.com\/intl\/en-gb\/feature\/testmysite\/\"><span style=\"font-weight: 400;\">https:\/\/www.thinkwithgoogle.com\/intl\/en-gb\/feature\/testmysite\/<\/span><\/a><span style=\"font-weight: 400;\">)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A tool that, in addition to speed optimizations, also proposes recommendations for improving UI, UX and overall simplification of the purchasing process. The tool primarily offers recommendations for e-shops, for classic sites it&#8217;s enough to use another tool.<\/span><\/p>\n<figure id=\"attachment_8104\" aria-describedby=\"caption-attachment-8104\" style=\"width: 1092px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/blog.bart.sk\/wp-content\/uploads\/2021\/10\/thinkwithgoogle.png\"><img loading=\"lazy\" decoding=\"async\" class=\"hoverZoomLink wp-image-8104 size-full\" src=\"https:\/\/blog.bart.sk\/wp-content\/uploads\/2021\/10\/thinkwithgoogle.png\" alt=\"Odpor\u00fa\u010dania pre eshopy zo slu\u017eby Think with Google\" width=\"1092\" height=\"437\" \/><\/a><figcaption id=\"caption-attachment-8104\" class=\"wp-caption-text\"><span style=\"font-weight: 400;\">Recommendations for e-shops from Think with Google<\/span><\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p><b>Webpagetest<\/b><\/p>\n<p><span style=\"font-weight: 400;\">(<\/span><a href=\"https:\/\/www.webpagetest.org\/\"><span style=\"font-weight: 400;\">https:\/\/www.webpagetest.org\/<\/span><\/a><span style=\"font-weight: 400;\">)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In addition to speed, it also checks the security of the site. The data that is returned is described in detail, but some links with improvements point to older documentation. The pie charts showing the work of the main thread are clear. Webpagetest also provides videos that show how fast a page is filled with content. Also a great feature is the <\/span><b>TBT <\/b><span style=\"font-weight: 400;\">(<\/span><b>T<\/b><span style=\"font-weight: 400;\">otal <\/span><b>B<\/b><span style=\"font-weight: 400;\">locking <\/span><b>T<\/b><span style=\"font-weight: 400;\">ime) visualization, which reveals problem areas in page loading.<\/span><\/p>\n<figure id=\"attachment_8105\" aria-describedby=\"caption-attachment-8105\" style=\"width: 1298px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/blog.bart.sk\/wp-content\/uploads\/2021\/10\/speed2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"hoverZoomLink wp-image-8105 size-full\" src=\"https:\/\/blog.bart.sk\/wp-content\/uploads\/2021\/10\/speed2.png\" alt=\"Popis pr\u00e1ce hlavn\u00e9ho vl\u00e1kna v n\u00e1stroji Webpagetest (https:\/\/www.webpagetest.org\/)\" width=\"1298\" height=\"603\" \/><\/a><figcaption id=\"caption-attachment-8105\" class=\"wp-caption-text\"><span style=\"font-weight: 400;\">Description of the work of the main thread in the Webpagetest tool (https:\/\/www.webpagetest.org\/)<\/span><\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p><b>Lighthouse<\/b><\/p>\n<p><span style=\"font-weight: 400;\">(<\/span><a href=\"https:\/\/developers.google.com\/web\/tools\/lighthouse?authuser=1\"><span style=\"font-weight: 400;\">https:\/\/developers.google.com\/web\/tools\/lighthouse<\/span><\/a><span style=\"font-weight: 400;\">)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Lighthouse is a general tool from Google which, in addition to speed, also checks the accessibility of the site, SEO and performs a general audit, so it&#8217;s suitable for general check of the site, not only from the point of view of page performance. The check can be started in the Google Chrome browser in the Lighthouse tab, in the command line by installing via <\/span><i><span style=\"font-weight: 400;\">npm<\/span><\/i><span style=\"font-weight: 400;\">, or in the code as a node module.<\/span><\/p>\n<figure id=\"attachment_8109\" aria-describedby=\"caption-attachment-8109\" style=\"width: 2000px\" class=\"wp-caption aligncenter\"><a class=\"hoverZoomLink\" href=\"https:\/\/blog.bart.sk\/wp-content\/uploads\/2021\/10\/lighthouse.png\"><img loading=\"lazy\" decoding=\"async\" class=\"hoverZoomLink wp-image-8109 size-large\" src=\"https:\/\/blog.bart.sk\/wp-content\/uploads\/2021\/10\/lighthouse-2000x1767.png\" alt=\"Lighthouse report (https:\/\/developers.google.com\/web\/tools\/lighthouse)\" width=\"2000\" height=\"1767\" \/><\/a><figcaption id=\"caption-attachment-8109\" class=\"wp-caption-text\">Lighthouse report (https:\/\/developers.google.com\/web\/tools\/lighthouse)<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p><strong>PageSpeed Insights<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">(<\/span><a href=\"https:\/\/developers.google.com\/speed\/pagespeed\/insights\/?authuser=1\"><span style=\"font-weight: 400;\">https:\/\/developers.google.com\/speed\/pagespeed\/insights\/<\/span><\/a><span style=\"font-weight: 400;\">)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A tool that primarily serves to analyze web speed and suggests recommendations for speed optimization.<\/span><\/p>\n<figure id=\"attachment_8110\" aria-describedby=\"caption-attachment-8110\" style=\"width: 1909px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/blog.bart.sk\/wp-content\/uploads\/2021\/10\/pagespeed.png\"><img loading=\"lazy\" decoding=\"async\" class=\"hoverZoomLink wp-image-8110 size-full\" src=\"https:\/\/blog.bart.sk\/wp-content\/uploads\/2021\/10\/pagespeed.png\" alt=\"Anal\u00fdza str\u00e1nky youtube.com v PageSpeed Insights\" width=\"1909\" height=\"872\" \/><\/a><figcaption id=\"caption-attachment-8110\" class=\"wp-caption-text\"><span style=\"font-weight: 400;\">Analysis of youtube.com in PageSpeed Insights<\/span><\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">The data analyzed by Pagespeed are divided into two parts. The first part, <\/span><i><span style=\"font-weight: 400;\">Field Data<\/span><\/i><span style=\"font-weight: 400;\">, shows the results of each metric from the data of the real users who loaded the page. In addition to the three Web Vitals metrics, the <\/span><b>FCP (F<\/b><span style=\"font-weight: 400;\">irst <\/span><b>C<\/b><span style=\"font-weight: 400;\">ontentful <\/span><b>P<\/b><span style=\"font-weight: 400;\">aint) metric is added, which measures the speed of loading the first content on the page. The second part of <\/span><i><span style=\"font-weight: 400;\">Lab Data<\/span><\/i><span style=\"font-weight: 400;\"> shows the results analyzed by Lighthouse. In addition to the three metrics <\/span><b>FCP<\/b><span style=\"font-weight: 400;\">, <\/span><b>LCP<\/b><span style=\"font-weight: 400;\"> and <\/span><b>CLS<\/b><span style=\"font-weight: 400;\">, three other metrics were added to the analysis:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><b>Speed Index<\/b><span style=\"font-weight: 400;\"> &#8211; Measures how fast a page fills up with content.<\/span><\/li>\n<li style=\"font-weight: 400;\"><b>Time to Interactive <\/b><span style=\"font-weight: 400;\">&#8211; Measures how long it takes for a page to become\u00a0 interactive (after clicking on a button or a link, the page responds).<\/span><\/li>\n<li style=\"font-weight: 400;\"><b>Total Blocking Time<\/b><span style=\"font-weight: 400;\"> &#8211; Calculates the sum of task times blocking the main thread.<\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_8111\" aria-describedby=\"caption-attachment-8111\" style=\"width: 717px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/blog.bart.sk\/wp-content\/uploads\/2021\/10\/pagespeed2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"hoverZoomLink wp-image-8111 size-full\" src=\"https:\/\/blog.bart.sk\/wp-content\/uploads\/2021\/10\/pagespeed2.png\" alt=\"Odpor\u00fa\u010dania na zlep\u0161enie r\u00fdchlosti str\u00e1nok v n\u00e1stroji PageSpeed Insights (https:\/\/developers.google.com\/speed\/pagespeed\/insights\/)\" width=\"717\" height=\"773\" \/><\/a><figcaption id=\"caption-attachment-8111\" class=\"wp-caption-text\"><span style=\"font-weight: 400;\">Recommendations for improving page speed in PageSpeed tool (https:\/\/developers.google.com\/speed\/pagespeed\/insights\/)<\/span><\/figcaption><\/figure>\n<p><span style=\"font-weight: 400;\">Below the metrics are recommendations on how to optimize each metric &#8211; in this particular case, these are recommendations for removing unused JavaScript and CSS and moving CSS processing that blocks the rendering of the page. In addition to these recommendations, PageSpeed provides additional information about a site (diagnostics) that can help us identify some issues, such as finding an LCP element, moving page content, etc.<\/span><\/p>\n<p>&nbsp;<\/p>\n<blockquote><p><i><span style=\"font-weight: 400;\">The score value in Pagespeed Insights can be relatively variable. 3 tests in 10 minutes can yield results that differ by as much as 30 points. Therefore, it&#8217;s advisable to run several tests after making modifications and take into account the average of the results.<\/span><\/i><\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">The results are further divided into two part<\/span><span style=\"font-weight: 400;\">s <\/span><span style=\"font-weight: 400;\">\u2013 <\/span><span style=\"font-weight: 400;\">Mo<\/span><span style=\"font-weight: 400;\">bile and Desktop. In the vast majority of cases, it is not such a problem to move the score on Desktop to high values, but the problem is made by tests on a mobile phone, where the tests are carried on a medium-strength Android phone and due to its weaker processor, the resulting score is usually worse. Pagespeed&#8217;s inconspicuous features include a score calculator and a <\/span><i><span style=\"font-weight: 400;\">Treemap<\/span><\/i><span style=\"font-weight: 400;\">. On the calculator we can test how our score will change if we improve (or even worsen) some metrics. Treemap shows<\/span> <span style=\"font-weight: 400;\">us the JS bundle <\/span><span style=\"font-weight: 400;\">\u2013<\/span><span style=\"font-weight: 400;\"> what it consists of and how much unused code it contains.<\/span><\/p>\n<figure id=\"attachment_8124\" aria-describedby=\"caption-attachment-8124\" style=\"width: 887px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/blog.bart.sk\/wp-content\/uploads\/2021\/10\/pagespeedtree.png\"><img loading=\"lazy\" decoding=\"async\" class=\"hoverZoomLink wp-image-8124 size-full\" src=\"https:\/\/blog.bart.sk\/wp-content\/uploads\/2021\/10\/pagespeedtree.png\" alt=\"Anal\u00fdza JS bundle v PageSpeed Insights\" width=\"887\" height=\"872\" \/><\/a><figcaption id=\"caption-attachment-8124\" class=\"wp-caption-text\">Anal\u00fdza JS bundle v PageSpeed Insights<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<h3>Speedlify<\/h3>\n<p>(<a href=\"https:\/\/www.speedlify.dev\/\">https:\/\/www.speedlify.dev\/<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\">Speedlify is an open-source tool that allows you to continuously track performance and other site metrics using Lighthouse. The results can be deployed, the site can be re-analyzed at night, and this way we can always have up-to-date data on the performance of our websites.<\/span><\/p>\n<figure id=\"attachment_8127\" aria-describedby=\"caption-attachment-8127\" style=\"width: 1644px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/blog.bart.sk\/wp-content\/uploads\/2021\/10\/speedlify.png\"><img loading=\"lazy\" decoding=\"async\" class=\"hoverZoomLink wp-image-8127 size-full\" src=\"https:\/\/blog.bart.sk\/wp-content\/uploads\/2021\/10\/speedlify.png\" alt=\"\" width=\"1644\" height=\"452\" \/><\/a><figcaption id=\"caption-attachment-8127\" class=\"wp-caption-text\"><span style=\"font-weight: 400;\">Speedlify results displayed on the web<\/span><\/figcaption><\/figure>\n<h2><b>Summary<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">We&#8217;ve introduced a number of tools that can help us control our site. <\/span><i><span style=\"font-weight: 400;\">Lighthouse<\/span><\/i><span style=\"font-weight: 400;\"> will help us with the overall control of the website in terms of usability and <\/span><i><span style=\"font-weight: 400;\">SEO<\/span><\/i><span style=\"font-weight: 400;\">, Webpagetest contains several useful features that can help us with optimization. PageSpeed Insights returns a useful score that shows how our site compares to other sites. The <\/span><i><span style=\"font-weight: 400;\">Speedlify <\/span><\/i><span style=\"font-weight: 400;\">tool can be used for continuous monitoring of speed, SEO or usability.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In the next part, we&#8217;ll look at specific speed optimizations.<\/span><\/p>\n<div id=\"hzImg\" style=\"background: none; line-height: 0px; overflow: hidden; padding: 5px; position: absolute; z-index: 2147483647; visibility: visible; opacity: 1; top: 72px; left: 187px; width: auto; height: auto; cursor: pointer; pointer-events: none; display: none;\"><\/div>\n<div id=\"hzImg\" style=\"background: none; line-height: 0px; overflow: hidden; padding: 5px; position: absolute; z-index: 2147483647; visibility: visible; opacity: 1; top: 1647px; left: 5px; width: auto; height: auto; cursor: pointer; pointer-events: none; display: none;\"><\/div>\n<div id=\"hzImg\" style=\"background: none; line-height: 0px; overflow: hidden; padding: 5px; position: absolute; z-index: 2147483647; visibility: visible; opacity: 1; top: 2137px; left: 5px; width: auto; height: auto; cursor: pointer; pointer-events: none; display: none;\"><\/div>\n<div id=\"hzImg\" style=\"background: none; line-height: 0px; overflow: hidden; padding: 5px; position: absolute; z-index: 2147483647; visibility: visible; opacity: 1; top: 1842px; left: 5px; width: auto; height: auto; display: none;\"><\/div>\n<div id=\"hzImg\" style=\"background: none; line-height: 0px; overflow: hidden; padding: 5px; position: absolute; z-index: 2147483647; visibility: visible; opacity: 1; top: 6585px; left: 5px; width: auto; height: auto; cursor: pointer; pointer-events: none;\"><\/div>\n<div id=\"hzImg\" style=\"background: none; line-height: 0px; overflow: hidden; padding: 5px; position: absolute; z-index: 2147483647; visibility: visible; opacity: 1; top: 144px; left: 111px; width: auto; height: auto; cursor: pointer; pointer-events: none; display: none;\"><\/div>\n<div id=\"hzImg\" style=\"background: none; line-height: 0px; overflow: hidden; padding: 5px; position: absolute; z-index: 2147483647; visibility: visible; opacity: 1; cursor: pointer; pointer-events: none; top: 1831px; left: 5px; width: auto; height: auto; display: none;\"><\/div>\n<div id=\"hzImg\" style=\"background: none; line-height: 0px; overflow: hidden; padding: 5px; position: absolute; z-index: 2147483647; visibility: visible; opacity: 1; top: 3443px; left: 5px; width: auto; height: auto; cursor: pointer; pointer-events: none; display: none;\"><\/div>\n<div id=\"hzImg\" style=\"background: none; line-height: 0px; overflow: hidden; padding: 5px; position: absolute; z-index: 2147483647; visibility: visible; opacity: 1; top: 2600px; left: 5px; width: auto; height: auto; cursor: pointer; pointer-events: none; display: none;\"><\/div>\n<div id=\"hzImg\" style=\"background: none; line-height: 0px; overflow: hidden; padding: 5px; position: absolute; z-index: 2147483647; visibility: visible; opacity: 1; top: 2709px; left: 5px; width: auto; height: auto; cursor: pointer; pointer-events: none; display: none;\"><\/div>\n<div id=\"hzImg\" style=\"background: none; line-height: 0px; overflow: hidden; padding: 5px; position: absolute; z-index: 2147483647; visibility: visible; opacity: 1; top: 2924px; left: 5px; width: auto; height: auto; cursor: pointer; pointer-events: none; display: none;\"><\/div>\n","protected":false},"excerpt":{"rendered":"Introduction What do Google, Walmart, Amazon, and AliExpress share? All four companies saw improved conversions, increased traffic and&hellip;","protected":false},"author":26,"featured_media":6580,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","csco_display_header_overlay":false,"csco_singular_sidebar":"","csco_page_header_type":""},"categories":[199,211],"tags":[227,228],"_links":{"self":[{"href":"https:\/\/blog.bart.sk\/en\/wp-json\/wp\/v2\/posts\/6555"}],"collection":[{"href":"https:\/\/blog.bart.sk\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bart.sk\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bart.sk\/en\/wp-json\/wp\/v2\/users\/26"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bart.sk\/en\/wp-json\/wp\/v2\/comments?post=6555"}],"version-history":[{"count":7,"href":"https:\/\/blog.bart.sk\/en\/wp-json\/wp\/v2\/posts\/6555\/revisions"}],"predecessor-version":[{"id":6562,"href":"https:\/\/blog.bart.sk\/en\/wp-json\/wp\/v2\/posts\/6555\/revisions\/6562"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.bart.sk\/en\/wp-json\/wp\/v2\/media\/6580"}],"wp:attachment":[{"href":"https:\/\/blog.bart.sk\/en\/wp-json\/wp\/v2\/media?parent=6555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bart.sk\/en\/wp-json\/wp\/v2\/categories?post=6555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bart.sk\/en\/wp-json\/wp\/v2\/tags?post=6555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}