{"id":8324,"date":"2017-10-11T06:00:31","date_gmt":"2017-10-11T10:00:31","guid":{"rendered":"https:\/\/blog.litespeedtech.com\/?p=8324"},"modified":"2017-10-11T06:00:31","modified_gmt":"2017-10-11T10:00:31","slug":"wpw-content-delivery-network-support","status":"publish","type":"post","link":"https:\/\/lswp.store\/index.php\/2017\/10\/11\/wpw-content-delivery-network-support\/","title":{"rendered":"WpW: Content Delivery Network Support"},"content":{"rendered":"<p><img fetchpriority=\"high\" decoding=\"async\" title=\"\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/10\/null-8.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>If you use a content delivery network (or CDN) along with LiteSpeed Cache for WordPress, this week\u2019s topic should appeal to you. You\u2019ve always been able to use LSCWP and a CDN together, but you needed an additional plugin to do so. Now, <strong>as of LSCWP v.1.2.3, we\u2019re officially supporting the use of CDNs, no additional plugin required!<\/strong><\/p>\n<p><em><strong>Please note<\/strong>: This article does not apply to Cloudflare. Cloudflare is not a typical CDN, in that it is a distributed proxy server, as opposed to a reverse-proxy. This article applies to reverse-proxy CDNs only.<\/em><\/p>\n<h2>What is a CDN?<\/h2>\n<p>Content delivery networks store static website content remotely in servers all around the world. The content may then be served to a site\u2019s visitor from the server that is physically closest to that visitor\u2019s location. The closer the server, the less time the data takes in transit. A CDN is a great complement to the page-caching functionality of LSCWP. LiteSpeed speeds up the serving of all of the dynamically-generated content, while the CDN speeds up the delivery of the static content (images, CSS, JavaScript, etc).<\/p>\n<h2>How does LSCWP support CDN use?<\/h2>\n<p><img decoding=\"async\" title=\"\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/10\/null-4.jpeg\" alt=\"\" width=\"672\" height=\"449\" \/><\/p>\n<p>When you start using a CDN for static content, those files stop being served from your site\u2019s file system, and instead are pulled directly from the CDN. WordPress requires a plugin to change all of the appropriate links to be CDN links. Without a plugin, you would have to manually change all of your static file links to point to the CDN\u2019s URL. Not only is that a nuisance, but it\u2019s not always possible to do.<\/p>\n<p>For all practical purposes, a plugin is required if you are going to use a CDN with WordPress.<\/p>\n<p>If you\u2019re already using a CDN alongside LSCWP, you\u2019ll know that they complement each other well. It\u2019s a nice bonus, then, that you can now configure both in a single plugin!<\/p>\n<p>If you\u2019re new to CDNs, you\u2019ll appreciate the ability to get yours up and running in a familiar plugin environment.<\/p>\n<h2>Setting it up<\/h2>\n<p>These settings link LSCWP to your existing CDN. If you don\u2019t currently use a CDN service, you\u2019ll have to obtain one before these settings will be of any use to you.<\/p>\n<p><img decoding=\"async\" title=\"\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/10\/null-9.png\" alt=\"\" width=\"672\" height=\"670\" \/><\/p>\n<p>LSCWP\u2019s CDN support works by substituting the CDN URL for your site\u2019s URL on the relevant static files. The settings below allow you to define the parameters for these substitutions. First specify the two URLs, and then choose the static files to be included or excluded.<\/p>\n<h3>Enable CDN<\/h3>\n<p>This is the button that enables the functionality. If this is not turned <code>ON<\/code> then none of the other options matter. CDN support is turned <code>OFF<\/code> by default.<\/p>\n<h3>Original URL and CDN URL<\/h3>\n<p><strong>Original URL<\/strong> defaults to your site&#8217;s root URI. It shouldn&#8217;t be necessary to change this. If you do change it, be sure that the URI begins with <code>\/\/<\/code> as in <code>\/\/yoursite.com<\/code>.<\/p>\n<p><strong>CDN URL<\/strong> is the root URL for content that is served from the CDN. It should be a full URL beginning with <code>http<\/code>.<\/p>\n<p>When LSCWP generates the cached static version of a dynamic page, these two settings work together to allow the CDN URL to be substituted for the Original URL where appropriate.<\/p>\n<h3>Includes<\/h3>\n<p>These settings allow you to specify which types of static content are being handled by your CDN. They are all turned off by default, but you may turn on whichever file types are appropriate for your application. The <strong>Include Images<\/strong> setting refers to images that are accessed via <code>img<\/code> tags and CSS <code>url()<\/code> attributes. Images accessed in any other manner can be included through the <strong>Include File Types<\/strong> setting.<\/p>\n<h3>Include File Types<\/h3>\n<p>This setting is for files that are accessed via <code>src<\/code>, <code>data-src<\/code>, and <code>href<\/code> tags.<\/p>\n<h3>Exclude Path<\/h3>\n<p>If there are sections of your site that are not served from the CDN, specify the paths here (one per line) so that LiteSpeed will not go to the CDN for those. You may enter partial paths here, no wildcards required.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/10\/null-5.jpeg\" alt=\"\" width=\"672\" height=\"449\" \/><\/p>\n<p>If you\u2019ve been running a site for any length of time, you know that WordPress offers many opportunities for optimization. (This is just a more positive way of saying \u201cWordPress can be really slow.\u201d) <a href=\"https:\/\/lswp.store\/2017\/07\/19\/wpw-litespeed-caching-101\/\">Page caching<\/a>, <a href=\"https:\/\/lswp.store\/2017\/10\/04\/wpw-using-browser-cache-in-lscache\/\">browser caching<\/a>, <a href=\"https:\/\/lswp.store\/2017\/09\/20\/wpw-database-optimization\/\">database optimization<\/a>, <a href=\"https:\/\/lswp.store\/2017\/09\/27\/wpw-minification-combination-and-http2-push\/\">minification, combination, HTTP\/2 Push<\/a>, and Content Delivery Networks are all excellent ways to speed up your site, and <strong>they are all supported in the LiteSpeed Cache for WordPress plugin<\/strong>!<\/p>\n<p>We hope you\u2019ll try some of these new features soon, if you haven\u2019t already, and let us know what you think. We love getting your feedback!<\/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","protected":false},"excerpt":{"rendered":"<p>You\u2019ve always been able to use LSCWP and a CDN alongside each other, but now you can do it with no additional plugin required!<\/p>\n","protected":false},"author":1,"featured_media":8326,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[28],"tags":[71,316,317],"class_list":["post-8324","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cache","tag-content-delivery-networks","tag-wordpress","tag-wordpress-wednesday"],"jetpack_featured_media_url":"https:\/\/lswp.store\/wp-content\/uploads\/2017\/10\/null-8.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts\/8324","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=8324"}],"version-history":[{"count":0,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts\/8324\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/media\/8326"}],"wp:attachment":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/media?parent=8324"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/categories?post=8324"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/tags?post=8324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}