{"id":8382,"date":"2017-10-25T06:00:07","date_gmt":"2017-10-25T10:00:07","guid":{"rendered":"https:\/\/blog.litespeedtech.com\/?p=8382"},"modified":"2017-10-25T06:00:07","modified_gmt":"2017-10-25T10:00:07","slug":"wpw-how-to-set-up-cloudflare-with-lscache","status":"publish","type":"post","link":"https:\/\/lswp.store\/index.php\/2017\/10\/25\/wpw-how-to-set-up-cloudflare-with-lscache\/","title":{"rendered":"WpW: How to Set Up a CDN with LSCache"},"content":{"rendered":"<p><img fetchpriority=\"high\" decoding=\"async\" title=\"\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/11\/null.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 v5.0. 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>LiteSpeed Cache for WordPress has the ability to <a href=\"https:\/\/lswp.store\/2017\/10\/11\/wpw-content-delivery-network-support\/\">support your Content Delivery Network usage<\/a>. This quick guide should explain how the different settings between your CDN and LiteSpeed relate to each other.<\/p>\n<h2>Cloudflare<\/h2>\n<p>Make sure you have set up your Cloudflare account on the Cloudflare website. Once that&#8217;s done, switch over to your WordPress Dashboard and navigate to <strong>LiteSpeed Cache &gt; CDN &gt; CDN Settings<\/strong>.<\/p>\n<p>To manage Cloudflare through the LSCache plugin, set the following:<\/p>\n<ul>\n<li><strong>QUIC Cloud CDN<\/strong>: <code>OFF<\/code><\/li>\n<li><strong>Use CDN Mapping<\/strong>: <code>OFF<\/code>, and leave all settings under it alone<\/li>\n<li><strong>Cloudflare API<\/strong>: <code>ON<\/code>, and fill in your <strong>Email Address<\/strong>, <strong>Global API Key<\/strong>, and <strong>Domain<\/strong><\/li>\n<\/ul>\n<p><strong>NOTE<\/strong>: You can also use Cloudflare without managing it through LSCache. If that is what you choose, just set <strong>Cloudflare API<\/strong> to <code>OFF<\/code>, and leave all settings under it alone. Cloudflare will work either way. The advantage of setting this up in LSCache is that you may purge your Cloudflare cache or enable Cloudflare&#8217;s Development Mode from within LSCache. If that doesn&#8217;t matter to you, feel free to skip this setup.<\/p>\n<h2>QUIC Cloud<\/h2>\n<p>The QUIC.cloud <a href=\"https:\/\/quic.cloud\/docs\/onboarding\/\">onboarding process<\/a> is documented in the QUIC.cloud Knowledge Base, and explains how to set up everything from the LSCache plugin to your QUIC.cloud Dashboard.<\/p>\n<h2>Other Reverse-Proxy CDNs<\/h2>\n<h3>CNAME setup in the CDN<\/h3>\n<p>For this guide, we\u2019re going to assume you have already set up your CDN account, and added your site (let\u2019s call it <code>example.com<\/code>) according to the CDN\u2019s instructions.<\/p>\n<p>Make sure that your CDN is configured to cache static files only. Dynamic content will be handled by LiteSpeed.<\/p>\n<p>Your CDN configuration screen should have an area for adding a CNAME record. Look for it under <strong>DNS Editor<\/strong> or something along those lines.<\/p>\n<p>The goal here is to set up a custom domain to be used only by the CDN. For example, <code>cdn.example.com<\/code>. Follow the CDN\u2019s instructions for adding the CNAME record.<\/p>\n<p>Once that is complete, and the domain is active, we\u2019ll be ready to tell WordPress how to proceed.<\/p>\n<h3>LiteSpeed Cache CDN Settings<\/h3>\n<p>Now that your CDN is set up and your static content is ready to be served by the CDN, you will need to let WordPress know about it. You can do this through LiteSpeed Cache.<\/p>\n<p>In your WordPress Dashboard, navigate to <strong>LiteSpeed Cache &gt; CDN &gt; CDN Settings<\/strong>.<\/p>\n<p>Make sure both <strong>QUIC Cloud CDN<\/strong> and <strong>Cloudflare API<\/strong> are set to <code>OFF<\/code>.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-11757\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/10\/lscwp-cdn-1.png\" alt=\"\" width=\"966\" height=\"742\" srcset=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/10\/lscwp-cdn-1.png 966w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/10\/lscwp-cdn-1-300x230.png 300w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/10\/lscwp-cdn-1-768x590.png 768w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/10\/lscwp-cdn-1-600x461.png 600w\" sizes=\"(max-width: 966px) 100vw, 966px\" \/><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-11759\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/10\/lscwp-cdn-2.png\" alt=\"\" width=\"949\" height=\"232\" srcset=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/10\/lscwp-cdn-2.png 949w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/10\/lscwp-cdn-2-300x73.png 300w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/10\/lscwp-cdn-2-768x188.png 768w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/10\/lscwp-cdn-2-600x147.png 600w\" sizes=\"(max-width: 949px) 100vw, 949px\" \/><\/p>\n<ul>\n<li><strong>Use CDN Mapping<\/strong>: <code>ON<\/code>.<\/li>\n<li><strong>CDN URL<\/strong>: <code>http:\/\/cdn.example.com<\/code>.<\/li>\n<li><strong>Original URLs<\/strong>: <code>\/\/example.com<\/code>.<\/li>\n<\/ul>\n<p>The remaining settings can be left as-is, unless you have a specific reason to change them. If you do want to adjust them, <a href=\"https:\/\/docs.litespeedtech.com\/lscache\/lscwp\/cdn\/\">this documentation should help<\/a>.<\/p>\n<p>And that\u2019s it! Once you save your changes, LiteSpeed Cache for WordPress will substitute the CDN URL for the Original URL in the static copies it saves of your dynamically-generated code, wherever appropriate.<\/p>\n<p>Want to learn more about how all of this works? We\u2019ve written about our CDN support in some depth before. You can check that out <a href=\"https:\/\/lswp.store\/2017\/10\/11\/wpw-content-delivery-network-support\/\">here<\/a>.<\/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 July of 2022. 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>A quick guide for setting up LSCache for WordPress and Cloudflare to work together.<\/p>\n","protected":false},"author":1,"featured_media":8516,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[28],"tags":[64,71,180,316,317],"class_list":["post-8382","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cache","tag-cloudflare","tag-content-delivery-networks","tag-maxcdn","tag-wordpress","tag-wordpress-wednesday"],"jetpack_featured_media_url":"https:\/\/lswp.store\/wp-content\/uploads\/2017\/11\/null.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts\/8382","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=8382"}],"version-history":[{"count":0,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts\/8382\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/media\/8516"}],"wp:attachment":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/media?parent=8382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/categories?post=8382"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/tags?post=8382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}