{"id":1837,"date":"2021-08-05T11:37:31","date_gmt":"2021-08-05T11:37:31","guid":{"rendered":"https:\/\/www.wpstaq.com\/?post_type=pagespeedinsights&amp;p=1837"},"modified":"2021-08-05T11:37:31","modified_gmt":"2021-08-05T11:37:31","slug":"reduce-the-impact-of-third-party-code","status":"publish","type":"pagespeedinsights","link":"https:\/\/www.wpstaq.com\/hk\/pagespeedinsights\/reduce-the-impact-of-third-party-code\/","title":{"rendered":"Reduce the impact of third-party code"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"overview\">Overview<\/h2>\n\n\n\n<p>Third-party code consists of analytics services, advertisements and other elements that are served from an external domain URL.<\/p>\n\n\n\n<p>These resources are often responsible for poor web performance, as they may contain scripts that prevent other tasks from being performed.<\/p>\n\n\n\n<p>They may also slow down your page for several other reasons including slow DNS lookups, server response errors, slow server response times, among others, which can impact your page performance.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-reduce-the-impact-of-third-party-code\">How to reduce the impact of third-party code?<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1-reviewing-your-website-s-third-party-scripts\">1) Reviewing your website&#8217;s third-party scripts<\/h3>\n\n\n\n<p>They help you identify and evaluate scripts and services that pop up on your webpage. We suggest only keeping third-party scripts and services that are actually adding value to your website and to remove all others.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"2-efficiently-loading-third-party-javascript\">2) Efficiently loading third-party JavaScript<\/h3>\n\n\n\n<p>Some of the suggestions include:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"a-deferring-the-loading-and-parsing-of-javascript\">a) Deferring the loading and parsing of JavaScript<\/h4>\n\n\n\n<p>Defer the parsing or loading of third-party JavaScript to reduce the initial download size, allowing other resources to be downloaded as well.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"b-establishing-early-connections-to-required-origins\">b) Establishing early connections to required origins<\/h4>\n\n\n\n<p>Use&nbsp;<code>preconnect<\/code>&nbsp;and&nbsp;<code>dns-prefetch<\/code>&nbsp;to establish early connections to important third-party origins.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"c-lazy-loading-third-party-resources\">c) Lazy-loading third-party resources<\/h4>\n\n\n\n<p>Lazy-load embedded third-party resources, especially, ones that are not above-the-fold to speed up page load.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"d-optimize-third-party-hosting\">d) Optimize third-party hosting<\/h4>\n\n\n\n<p>There&#8217;s more than one way to optimize third-party hosting. Self-host third party scripts to reduce DNS lookup and round-trip times, improve http caching headers, and take advantages of HTTP\/2 server push.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"reduce-the-impact-of-third-party-code-with-staq\">Reduce the impact of third party code with Staq<\/h2>\n\n\n\n<p>To optimize, go to <strong>Site Optimizer > 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","protected":false},"template":"","class_list":["post-1837","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>Reduce the impact of third-party code - 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\/reduce-the-impact-of-third-party-code\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Reduce the impact of third-party code - How to fix really quickly with Staq\" \/>\n<meta property=\"og:description\" content=\"Overview Third-party code consists of analytics services, advertisements and other elements that are served from an external domain URL. These resources are often responsible for poor web performance, as they may contain scripts that prevent other tasks from being performed. They may also slow down your page for several other reasons including slow DNS lookups,&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wpstaq.com\/pagespeedinsights\/reduce-the-impact-of-third-party-code\/\" \/>\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\\\/reduce-the-impact-of-third-party-code\\\/\",\"url\":\"https:\\\/\\\/www.wpstaq.com\\\/pagespeedinsights\\\/reduce-the-impact-of-third-party-code\\\/\",\"name\":\"Reduce the impact of third-party code - How to fix really quickly with Staq\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/pagespeedinsights\\\/reduce-the-impact-of-third-party-code\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/pagespeedinsights\\\/reduce-the-impact-of-third-party-code\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.wpstaq.com\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/delay-javascript-1024x864.png\",\"datePublished\":\"2021-08-05T11:37:31+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/pagespeedinsights\\\/reduce-the-impact-of-third-party-code\\\/#breadcrumb\"},\"inLanguage\":\"en-hk\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.wpstaq.com\\\/pagespeedinsights\\\/reduce-the-impact-of-third-party-code\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-hk\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/pagespeedinsights\\\/reduce-the-impact-of-third-party-code\\\/#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\\\/reduce-the-impact-of-third-party-code\\\/#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\":\"Reduce the impact of third-party code\"}]},{\"@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-hk\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#organization\",\"name\":\"Staq\",\"alternateName\":\"WPStaq\",\"url\":\"https:\\\/\\\/www.wpstaq.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-hk\",\"@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":"Reduce the impact of third-party code - 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\/reduce-the-impact-of-third-party-code\/","og_locale":"en_US","og_type":"article","og_title":"Reduce the impact of third-party code - How to fix really quickly with Staq","og_description":"Overview Third-party code consists of analytics services, advertisements and other elements that are served from an external domain URL. These resources are often responsible for poor web performance, as they may contain scripts that prevent other tasks from being performed. They may also slow down your page for several other reasons including slow DNS lookups,&hellip;","og_url":"https:\/\/www.wpstaq.com\/pagespeedinsights\/reduce-the-impact-of-third-party-code\/","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\/reduce-the-impact-of-third-party-code\/","url":"https:\/\/www.wpstaq.com\/pagespeedinsights\/reduce-the-impact-of-third-party-code\/","name":"Reduce the impact of third-party code - How to fix really quickly with Staq","isPartOf":{"@id":"https:\/\/www.wpstaq.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.wpstaq.com\/pagespeedinsights\/reduce-the-impact-of-third-party-code\/#primaryimage"},"image":{"@id":"https:\/\/www.wpstaq.com\/pagespeedinsights\/reduce-the-impact-of-third-party-code\/#primaryimage"},"thumbnailUrl":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2022\/02\/delay-javascript-1024x864.png","datePublished":"2021-08-05T11:37:31+00:00","breadcrumb":{"@id":"https:\/\/www.wpstaq.com\/pagespeedinsights\/reduce-the-impact-of-third-party-code\/#breadcrumb"},"inLanguage":"en-hk","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wpstaq.com\/pagespeedinsights\/reduce-the-impact-of-third-party-code\/"]}]},{"@type":"ImageObject","inLanguage":"en-hk","@id":"https:\/\/www.wpstaq.com\/pagespeedinsights\/reduce-the-impact-of-third-party-code\/#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\/reduce-the-impact-of-third-party-code\/#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":"Reduce the impact of third-party code"}]},{"@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-hk"},{"@type":"Organization","@id":"https:\/\/www.wpstaq.com\/#organization","name":"Staq","alternateName":"WPStaq","url":"https:\/\/www.wpstaq.com\/","logo":{"@type":"ImageObject","inLanguage":"en-hk","@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\/hk\/wp-json\/wp\/v2\/pagespeedinsights\/1837","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wpstaq.com\/hk\/wp-json\/wp\/v2\/pagespeedinsights"}],"about":[{"href":"https:\/\/www.wpstaq.com\/hk\/wp-json\/wp\/v2\/types\/pagespeedinsights"}],"wp:attachment":[{"href":"https:\/\/www.wpstaq.com\/hk\/wp-json\/wp\/v2\/media?parent=1837"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}