{"id":8886,"date":"2018-01-10T03:00:13","date_gmt":"2018-01-10T07:00:13","guid":{"rendered":"https:\/\/blog.litespeedtech.com\/?p=8886"},"modified":"2018-01-10T03:00:13","modified_gmt":"2018-01-10T07:00:13","slug":"wordpress-prefetch-with-litespeed-cache","status":"publish","type":"post","link":"https:\/\/lswp.store\/index.php\/2018\/01\/10\/wordpress-prefetch-with-litespeed-cache\/","title":{"rendered":"WpW: DNS Prefetch with LiteSpeed Cache"},"content":{"rendered":"<p><img fetchpriority=\"high\" decoding=\"async\" title=\"\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2018\/01\/null-3.png\" alt=\"\" width=\"640\" height=\"320\" \/><\/p>\n<p>Welcome to another installment of <a href=\"http:\/\/blog.litespeedtech.com\/tag\/wordpress-wednesday\">WordPress Wednesday<\/a>!<\/p>\n<p><strong>Disclaimer<\/strong>: The information contained in this post is accurate for LSCWP v7.5.0.1 [<a href=\"https:\/\/wordpress.org\/plugins\/litespeed-cache\/#developers\">release log<\/a>]. If you are using a newer version of the plugin, some details may have changed. Please<a href=\"https:\/\/docs.litespeedtech.com\/lscache\/lscwp\/\"> refer to our documentation<\/a> for the latest!<\/p>\n<p>You may have noticed the <strong>DNS Prefetch<\/strong> option in the LiteSpeed Cache for WordPress settings. Today, we\u2019ll talk a little bit about what that feature does and how to use it.<\/p>\n<h2>What Problem Does DNS Prefetch Solve?<\/h2>\n<p>There are all kinds of metrics to measure the actual page load time of your site, but what about the <em>perceived<\/em> speed? If a visitor feels like interacting with your site is slow, then it doesn\u2019t matter what your PageSpeed score tells you!<\/p>\n<p>One area in which you have the power to reduce user-perceived latency is DNS resolution.<\/p>\n<p>If a visitor clicks an external link on your site, and then sits there for several seconds while the browser looks up the site\u2019s IP address, <em>it can feel like it\u2019s your site that\u2019s sluggish<\/em>, even if your site has nothing at all to do with it! DNS Prefetch can eliminate the wait by doing the lookup before the visitor even clicks the link.<\/p>\n<p>While your visitor is looking over your page and reading your engaging content, their browser can be quietly looking up IP addresses in anticipation of the visitor\u2019s next click.<\/p>\n<h2>Example<\/h2>\n<p><img decoding=\"async\" title=\"\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2018\/01\/null.jpeg\" alt=\"\" width=\"672\" height=\"448\" \/><\/p>\n<p>Obviously, if you link to a lot of outside sources on your site, it\u2019s not going to be practical to prefetch every one. There are a few situations, though, where this ability comes in especially handy.<\/p>\n<p>Say you have a WordPress blog at <code>https:\/\/www.mybirdsite.com<\/code> and you regularly publish posts discussing bird-related books and gifts that are for sale in your online shop. The book and gift store is located at <code>https:\/\/shop.mybirdsite.com<\/code>. Now, wouldn\u2019t it be nice if a visitor to your blog could click to buy that book about hawks without having to wait for DNS resolution?<\/p>\n<p>If you want navigation from the blog to the shop to be seamless and to behave like it\u2019s one big site, then it is helpful to enable DNS Prefetch for <code>\/\/shop.mybirdsite.com<\/code>. With DNS Prefetch enabled, a visitor can shop without delay.<\/p>\n<h2>Which Browsers Support DNS Prefetch?<\/h2>\n<p>Most modern browsers support DNS Prefetch for HTTP, as seen <a href=\"https:\/\/caniuse.com\/#search=dns-prefetch\">in this chart<\/a>. Both Chrome and Firefox have DNS prefetching over HTTPS disabled by default, but it may be enabled by savvy users. (I did not find anything to suggest that the other browsers differentiate between HTTP and HTTPS in this way.)<\/p>\n<h2>How to set up DNS Prefetch with LiteSpeed Cache<\/h2>\n<p><img decoding=\"async\" class=\"aligncenter size-large wp-image-13181\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2018\/01\/Screenshot-2025-09-26-150611-1024x670.png\" alt=\"DNS Prefetch with LiteSpeed\" width=\"1024\" height=\"670\" srcset=\"https:\/\/lswp.store\/wp-content\/uploads\/2018\/01\/Screenshot-2025-09-26-150611-1024x670.png 1024w, https:\/\/lswp.store\/wp-content\/uploads\/2018\/01\/Screenshot-2025-09-26-150611-300x196.png 300w, https:\/\/lswp.store\/wp-content\/uploads\/2018\/01\/Screenshot-2025-09-26-150611-768x503.png 768w, https:\/\/lswp.store\/wp-content\/uploads\/2018\/01\/Screenshot-2025-09-26-150611-600x393.png 600w, https:\/\/lswp.store\/wp-content\/uploads\/2018\/01\/Screenshot-2025-09-26-150611.png 1215w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>From the WordPress Dashboard, navigate to <strong>LiteSpeed Cache &gt; Page Optimization &gt; HTML Settings<\/strong>. Scroll down the <strong>DNS Prefetch<\/strong>. Enter the domain names to prefetch, one per line, using the format <code>\/\/www.example.com<\/code>.<\/p>\n<p>And that\u2019s it. Setup couldn\u2019t be easier!<\/p>\n<p>Want more information about DNS Prefetch? The Chromium Projects has <a href=\"https:\/\/dev.chromium.org\/developers\/design-documents\/dns-prefetching\">a detailed Design Document writeup<\/a>, and Mozilla describes <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/X-DNS-Prefetch-Control\">how the response header works<\/a>.<\/p>\n<p>If you have any questions about how DNS Prefetch could benefit your site, let us know in the comments!<\/p>\n<p>&#8212;<\/p>\n<p>Have some of your own ideas for future <a href=\"http:\/\/blog.litespeedtech.com\/tag\/wordpress-wednesday\">WordPress Wednesday<\/a> topics? Leave us a comment!<\/p>\n<p>Don\u2019t forget to meet us back here next week for the next installment. In the meantime, here are a few other things you can do:<\/p>\n<ul>\n<li>Subscribe to the <a href=\"http:\/\/blog.litespeedtech.com\/tag\/wordpress-wednesday\/feed\/\">WordPress Wednesday RSS feed<\/a><\/li>\n<li>Download <a href=\"https:\/\/wordpress.org\/plugins\/litespeed-cache\/\">LiteSpeed Cache for WordPress plugin<\/a><\/li>\n<li>Learn more about the plugin <a href=\"https:\/\/www.litespeedtech.com\/products\/cache-plugins\/wordpress-acceleration\">on our website<\/a><\/li>\n<\/ul>\n<p>\u2014<br \/>\n<em>This content was last verified and updated in September of 2025. If you find an inaccuracy, please let us know! In the meantime, see <a href=\"https:\/\/docs.litespeedtech.com\/\">our documentation site<\/a>\u00a0for the most up-to-date information.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>One area in which you have the power to reduce user-perceived latency is DNS resolution. Use the new DNS Prefetch setting in LSCache.<\/p>\n","protected":false},"author":1,"featured_media":8888,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[28],"tags":[92,316,317],"class_list":["post-8886","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cache","tag-dns-prefetch","tag-wordpress","tag-wordpress-wednesday"],"jetpack_featured_media_url":"https:\/\/lswp.store\/wp-content\/uploads\/2018\/01\/null-3.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts\/8886","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/comments?post=8886"}],"version-history":[{"count":0,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts\/8886\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/media\/8888"}],"wp:attachment":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/media?parent=8886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/categories?post=8886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/tags?post=8886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}