{"id":704,"date":"2019-11-11T08:06:49","date_gmt":"2019-11-11T08:06:49","guid":{"rendered":"http:\/\/pwa-for-wp.com\/docs\/?post_type=ht_kb&#038;p=704"},"modified":"2019-11-11T10:10:40","modified_gmt":"2019-11-11T10:10:40","slug":"how-to-enable-cdn-compatibility-in-pwa","status":"publish","type":"ht_kb","link":"https:\/\/pwa-for-wp.com\/docs\/article\/how-to-enable-cdn-compatibility-in-pwa\/","title":{"rendered":"How to enable CDN Compatibility in PWA"},"content":{"rendered":"\n<p>CDN as we know it caches the data like CSS js etc. <\/p>\n\n\n\n<p>Our PWA based on serviceworker.js, so when users are Enable the CDN on their site, it&#8217;s changed the serving URL of service-worker.js also.<\/p>\n\n\n\n<p>Because of that PWA Service workers are not installing properly.<\/p>\n\n\n\n<p>For the solution of this situation we created an option as follows:<\/p>\n\n\n\n<p>First, go to <strong>WordPress Dashboard<\/strong>&nbsp;-&gt; Navigate to&nbsp;<strong>PWA<\/strong>&nbsp;-&gt;<strong>&nbsp;Settings -&gt; Advanced<\/strong> -&gt; Enable &#8220;<strong>CDN Compatibility<\/strong>&#8221; option and then click on the &#8220;<strong>Save Setting<\/strong>&#8221; option.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"401\" src=\"https:\/\/pwa-for-wp.com\/docs\/wp-content\/uploads\/2019\/11\/2-1024x401.png\" alt=\"\" class=\"wp-image-705\" srcset=\"https:\/\/pwa-for-wp.com\/docs\/wp-content\/uploads\/2019\/11\/2-1024x401.png 1024w, https:\/\/pwa-for-wp.com\/docs\/wp-content\/uploads\/2019\/11\/2-300x117.png 300w, https:\/\/pwa-for-wp.com\/docs\/wp-content\/uploads\/2019\/11\/2-768x300.png 768w, https:\/\/pwa-for-wp.com\/docs\/wp-content\/uploads\/2019\/11\/2-50x20.png 50w, https:\/\/pwa-for-wp.com\/docs\/wp-content\/uploads\/2019\/11\/2-60x23.png 60w, https:\/\/pwa-for-wp.com\/docs\/wp-content\/uploads\/2019\/11\/2-100x39.png 100w, https:\/\/pwa-for-wp.com\/docs\/wp-content\/uploads\/2019\/11\/2.png 1038w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li> <strong>CDN Compatibility<\/strong>: By using this option you remove conflict with the CDN  <\/li><\/ul>\n\n\n\n<p><strong>That\u2019s it for this tutorial!<\/strong><\/p>\n\n\n\n<p>We hope we\u2019ve clear your doubts in case If you have any feedback or questions, Just contact us&nbsp;<strong>here and<\/strong>&nbsp;we are always available for you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CDN as we know it caches the data like CSS js etc. Our PWA based on serviceworker.js, so when users are Enable the CDN on their site, it&#8217;s changed the serving URL of service-worker.js also. Because of that PWA Service workers are not installing properly. For the solution of this&#8230;<\/p>\n","protected":false},"author":3,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[6],"ht-kb-tag":[],"class_list":["post-704","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-how-to"],"_links":{"self":[{"href":"https:\/\/pwa-for-wp.com\/docs\/wp-json\/wp\/v2\/ht-kb\/704","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pwa-for-wp.com\/docs\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/pwa-for-wp.com\/docs\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/pwa-for-wp.com\/docs\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/pwa-for-wp.com\/docs\/wp-json\/wp\/v2\/comments?post=704"}],"version-history":[{"count":8,"href":"https:\/\/pwa-for-wp.com\/docs\/wp-json\/wp\/v2\/ht-kb\/704\/revisions"}],"predecessor-version":[{"id":720,"href":"https:\/\/pwa-for-wp.com\/docs\/wp-json\/wp\/v2\/ht-kb\/704\/revisions\/720"}],"wp:attachment":[{"href":"https:\/\/pwa-for-wp.com\/docs\/wp-json\/wp\/v2\/media?parent=704"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/pwa-for-wp.com\/docs\/wp-json\/wp\/v2\/ht-kb-category?post=704"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/pwa-for-wp.com\/docs\/wp-json\/wp\/v2\/ht-kb-tag?post=704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}