{"id":1836,"date":"2021-08-05T11:37:12","date_gmt":"2021-08-05T11:37:12","guid":{"rendered":"https:\/\/www.wpstaq.com\/?post_type=pagespeedinsights&amp;p=1836"},"modified":"2021-08-05T11:37:12","modified_gmt":"2021-08-05T11:37:12","slug":"minimize-main-thread-work","status":"publish","type":"pagespeedinsights","link":"https:\/\/www.wpstaq.com\/gb\/pagespeedinsights\/minimize-main-thread-work\/","title":{"rendered":"Minimize main-thread work"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"overview\">Overview<\/h2>\n\n\n\n<p>&#8216;Minimizing main-thread work&#8217; is a high impact audit within the context of your site performance.<\/p>\n\n\n\n<p>The&nbsp;<strong>main-thread<\/strong>&nbsp;handles most of the processes involved in loading your page. How fast your page loads depends on how much work the main-thread needs to do.<\/p>\n\n\n\n<p>It is important to ensure that the&nbsp;<strong>main-thread is not kept busy for too long<\/strong>&nbsp;so that your page renders fast and remains responsive.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-fix-audit\">How to minimize main-thread work?<\/h2>\n\n\n\n<p>Minimizing main-thread work should be one of the foremost goals in your development workflow.<\/p>\n\n\n\n<p>Main-thread work can largely be minimized by:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>reducing the time spent evaluating scripts.<\/li><li>minimizing style and layout recalculations.<\/li><li>reducing the time spent parsing CSS\/HTML\/JavaScript.<\/li><li>preventing the delay in rendering page pixels.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"minimize-main-thread-work-with-staq\">Minimize main-thread work with Staq<\/h2>\n\n\n\n<p>To optimize, go to <strong>Site Optimizer &gt; JavaScript<\/strong>. Then turn on: <strong>Delay JavaScript execution.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2022\/02\/delay-javascript-1024x864.png\" alt=\"\" class=\"wp-image-6172\"\/><\/figure>\n\n\n\n<p>Go to\u00a0<strong>Site Optimizer > Extra Options<\/strong>, and enable\u00a0<strong>Optimize HTML<\/strong>\u00a0in order to reduce your DOM size and minimize main-thread work:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2022\/01\/Screen-Shot-2022-01-13-at-1.34.57-pm.png\" alt=\"\"\/><\/figure>\n","protected":false},"template":"","class_list":["post-1836","pagespeedinsights","type-pagespeedinsights","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Minimize main-thread work - How to fix really quickly with Staq<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wpstaq.com\/pagespeedinsights\/minimize-main-thread-work\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Minimize main-thread work - How to fix really quickly with Staq\" \/>\n<meta property=\"og:description\" content=\"Overview &#8216;Minimizing main-thread work&#8217; is a high impact audit within the context of your site performance. The&nbsp;main-thread&nbsp;handles most of the processes involved in loading your page. How fast your page loads depends on how much work the main-thread needs to do. It is important to ensure that the&nbsp;main-thread is not kept busy for too long&nbsp;so&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wpstaq.com\/pagespeedinsights\/minimize-main-thread-work\/\" \/>\n<meta property=\"og:site_name\" content=\"Managed Hosting Platform for WordPress\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/staqhosting\/\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2022\/02\/delay-javascript-1024x864.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/pagespeedinsights\\\/minimize-main-thread-work\\\/\",\"url\":\"https:\\\/\\\/www.wpstaq.com\\\/pagespeedinsights\\\/minimize-main-thread-work\\\/\",\"name\":\"Minimize main-thread work - How to fix really quickly with Staq\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/pagespeedinsights\\\/minimize-main-thread-work\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/pagespeedinsights\\\/minimize-main-thread-work\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.wpstaq.com\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/delay-javascript-1024x864.png\",\"datePublished\":\"2021-08-05T11:37:12+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/pagespeedinsights\\\/minimize-main-thread-work\\\/#breadcrumb\"},\"inLanguage\":\"en-gb\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.wpstaq.com\\\/pagespeedinsights\\\/minimize-main-thread-work\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-gb\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/pagespeedinsights\\\/minimize-main-thread-work\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.wpstaq.com\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/delay-javascript-1024x864.png\",\"contentUrl\":\"https:\\\/\\\/www.wpstaq.com\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/delay-javascript-1024x864.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/pagespeedinsights\\\/minimize-main-thread-work\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.wpstaq.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PageSpeedInsights\",\"item\":\"https:\\\/\\\/www.wpstaq.com\\\/pagespeedinsights\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Minimize main-thread work\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#website\",\"url\":\"https:\\\/\\\/www.wpstaq.com\\\/\",\"name\":\"Managed Hosting Platform for WordPress\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.wpstaq.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-gb\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#organization\",\"name\":\"Staq\",\"alternateName\":\"WPStaq\",\"url\":\"https:\\\/\\\/www.wpstaq.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-gb\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.wpstaq.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/cropped-LogoNoText.png\",\"contentUrl\":\"https:\\\/\\\/www.wpstaq.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/cropped-LogoNoText.png\",\"width\":512,\"height\":512,\"caption\":\"Staq\"},\"image\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/staqhosting\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/wpstaq\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Minimize main-thread work - How to fix really quickly with Staq","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wpstaq.com\/pagespeedinsights\/minimize-main-thread-work\/","og_locale":"en_US","og_type":"article","og_title":"Minimize main-thread work - How to fix really quickly with Staq","og_description":"Overview &#8216;Minimizing main-thread work&#8217; is a high impact audit within the context of your site performance. The&nbsp;main-thread&nbsp;handles most of the processes involved in loading your page. How fast your page loads depends on how much work the main-thread needs to do. It is important to ensure that the&nbsp;main-thread is not kept busy for too long&nbsp;so&hellip;","og_url":"https:\/\/www.wpstaq.com\/pagespeedinsights\/minimize-main-thread-work\/","og_site_name":"Managed Hosting Platform for WordPress","article_publisher":"https:\/\/www.facebook.com\/staqhosting\/","og_image":[{"url":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2022\/02\/delay-javascript-1024x864.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wpstaq.com\/pagespeedinsights\/minimize-main-thread-work\/","url":"https:\/\/www.wpstaq.com\/pagespeedinsights\/minimize-main-thread-work\/","name":"Minimize main-thread work - How to fix really quickly with Staq","isPartOf":{"@id":"https:\/\/www.wpstaq.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.wpstaq.com\/pagespeedinsights\/minimize-main-thread-work\/#primaryimage"},"image":{"@id":"https:\/\/www.wpstaq.com\/pagespeedinsights\/minimize-main-thread-work\/#primaryimage"},"thumbnailUrl":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2022\/02\/delay-javascript-1024x864.png","datePublished":"2021-08-05T11:37:12+00:00","breadcrumb":{"@id":"https:\/\/www.wpstaq.com\/pagespeedinsights\/minimize-main-thread-work\/#breadcrumb"},"inLanguage":"en-gb","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wpstaq.com\/pagespeedinsights\/minimize-main-thread-work\/"]}]},{"@type":"ImageObject","inLanguage":"en-gb","@id":"https:\/\/www.wpstaq.com\/pagespeedinsights\/minimize-main-thread-work\/#primaryimage","url":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2022\/02\/delay-javascript-1024x864.png","contentUrl":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2022\/02\/delay-javascript-1024x864.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.wpstaq.com\/pagespeedinsights\/minimize-main-thread-work\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.wpstaq.com\/"},{"@type":"ListItem","position":2,"name":"PageSpeedInsights","item":"https:\/\/www.wpstaq.com\/pagespeedinsights\/"},{"@type":"ListItem","position":3,"name":"Minimize main-thread work"}]},{"@type":"WebSite","@id":"https:\/\/www.wpstaq.com\/#website","url":"https:\/\/www.wpstaq.com\/","name":"Managed Hosting Platform for WordPress","description":"","publisher":{"@id":"https:\/\/www.wpstaq.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wpstaq.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-gb"},{"@type":"Organization","@id":"https:\/\/www.wpstaq.com\/#organization","name":"Staq","alternateName":"WPStaq","url":"https:\/\/www.wpstaq.com\/","logo":{"@type":"ImageObject","inLanguage":"en-gb","@id":"https:\/\/www.wpstaq.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2023\/05\/cropped-LogoNoText.png","contentUrl":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2023\/05\/cropped-LogoNoText.png","width":512,"height":512,"caption":"Staq"},"image":{"@id":"https:\/\/www.wpstaq.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/staqhosting\/","https:\/\/www.linkedin.com\/company\/wpstaq"]}]}},"_links":{"self":[{"href":"https:\/\/www.wpstaq.com\/gb\/wp-json\/wp\/v2\/pagespeedinsights\/1836","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wpstaq.com\/gb\/wp-json\/wp\/v2\/pagespeedinsights"}],"about":[{"href":"https:\/\/www.wpstaq.com\/gb\/wp-json\/wp\/v2\/types\/pagespeedinsights"}],"wp:attachment":[{"href":"https:\/\/www.wpstaq.com\/gb\/wp-json\/wp\/v2\/media?parent=1836"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}