{"id":65,"date":"2022-11-29T06:09:42","date_gmt":"2022-11-29T06:09:42","guid":{"rendered":"https:\/\/superpwa.com\/documentation\/?post_type=ht_kb&#038;p=65"},"modified":"2022-11-30T04:38:46","modified_gmt":"2022-11-30T04:38:46","slug":"how-to-setup-precaching-in-superpwa","status":"publish","type":"ht_kb","link":"https:\/\/superpwa.com\/docs\/article\/how-to-setup-precaching-in-superpwa\/","title":{"rendered":"How to Setup Precaching in SuperPWA"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>Introduction to Precaching:&nbsp;<\/strong>One of the most important features of SuperPWAs is the ability to load fast and to work on slow network conditions or even offline. To achieve this, we can use a service worker to precache the app and, when available, use the network only to fetch necessary data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In our <strong><a href=\"https:\/\/wordpress.org\/plugins\/super-progressive-web-apps\/\">SuperPWA<\/a><\/strong> plugin, we\u2019ve implemented the Pre-caching functionality which helps you to cache the content.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>There are two ways you can cache the content&nbsp;<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong><a href=\"https:\/\/superpwa.com\/doc\/how-to-setup-precaching-in-superpwa\/#1-automatic\">Automatic<\/a><\/strong><\/li>\n\n\n\n<li><strong><a href=\"https:\/\/superpwa.com\/doc\/how-to-setup-precaching-in-superpwa\/#2-manual\">Manual<\/a><\/strong><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 1:<\/strong> You need to go&nbsp;to&nbsp;<strong>WordPress Dashboard&nbsp;<\/strong>-&gt;&nbsp;<strong>SuperPWA<\/strong>&nbsp;-&gt;<strong>&nbsp;Add-ons<\/strong>-&gt; Click on the <strong>Caching Strategies<\/strong> Add-on &#8220;<strong>Activate<\/strong>&#8221; button<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/superpwa.com\/wp-content\/uploads\/2021\/12\/71.png\" alt=\"71\" class=\"wp-image-12260\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 2:<\/strong> After Activating <strong>Caching Strategies<\/strong> plugin you need to click on the settings button as shown below the screenshot.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/superpwa.com\/wp-content\/uploads\/2021\/12\/Super-Progressive-Web-Apps-\u2039-Demo-wodpress-\u2014-WordPress-4.png\" alt=\"Super Progressive Web Apps \u2039 Demo Wodpress \u2014 WordPress 4\" class=\"wp-image-12263\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"1-automatic\">1) <strong>Automatic<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Now you can access the Settings page. By enabling&nbsp;the Automatic&nbsp;option you can cache the Post, Page, and Custom Post Type, and also you can set the number of posts that you want to cache.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/superpwa.com\/wp-content\/uploads\/2021\/12\/Super-Progressive-Web-Apps-\u2039-Demo-wodpress-\u2014-WordPress-3-1.png\" alt=\"Super Progressive Web Apps \u2039 Demo Wodpress \u2014 WordPress 3 1\" class=\"wp-image-12262\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"2-manual\"><strong>2) Manual<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You will find this option in the&nbsp;<strong>WordPress Dashboard<\/strong>&nbsp;-&gt;<strong>&nbsp;SuperPWA&nbsp;<\/strong>-&gt;&nbsp;<strong>Settings<\/strong>&nbsp;-&gt;&nbsp;<strong>Features<\/strong> <strong>(Addons)<\/strong>&nbsp;-&gt;After Activating <strong>Caching Strategies<\/strong> plugin<strong> <\/strong>you can access setting page. By enabling&nbsp;the <strong>Manual<\/strong>&nbsp;option, you can directly add the URLs which you want to get the cache.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/superpwa.com\/wp-content\/uploads\/2021\/12\/Super-Progressive-Web-Apps-\u2039-Demo-wodpress-\u2014-WordPress-5.png\" alt=\"Super Progressive Web Apps \u2039 Demo Wodpress \u2014 WordPress 5\" class=\"wp-image-12264\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> You can cache as many posts as you want but it will be better if you use 10 posts for better performance.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>That\u2019s it for this tutorial!<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We hope we\u2019ve clear your doubts in case If you have any feedback or questions, Just contact us&nbsp;<strong><a href=\"https:\/\/superpwa.com\/contact\/\">here<\/a> <\/strong>and&nbsp;we are always available for you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction to Precaching:&nbsp;One of the most important features of SuperPWAs is the ability to load fast and to work on slow network conditions or even offline. To achieve this, we can use a service worker to precache the app and, when available, use the network only to fetch necessary data&#8230;.<\/p>\n","protected":false},"author":1,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[17],"ht-kb-tag":[],"class_list":["post-65","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-how-to"],"_links":{"self":[{"href":"https:\/\/superpwa.com\/docs\/wp-json\/wp\/v2\/ht-kb\/65","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/superpwa.com\/docs\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/superpwa.com\/docs\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/superpwa.com\/docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/superpwa.com\/docs\/wp-json\/wp\/v2\/comments?post=65"}],"version-history":[{"count":5,"href":"https:\/\/superpwa.com\/docs\/wp-json\/wp\/v2\/ht-kb\/65\/revisions"}],"predecessor-version":[{"id":185,"href":"https:\/\/superpwa.com\/docs\/wp-json\/wp\/v2\/ht-kb\/65\/revisions\/185"}],"wp:attachment":[{"href":"https:\/\/superpwa.com\/docs\/wp-json\/wp\/v2\/media?parent=65"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/superpwa.com\/docs\/wp-json\/wp\/v2\/ht-kb-category?post=65"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/superpwa.com\/docs\/wp-json\/wp\/v2\/ht-kb-tag?post=65"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}