{"id":67391,"date":"2019-06-27T04:19:20","date_gmt":"2019-06-27T11:19:20","guid":{"rendered":"http:\/\/www.taterboy.com\/blog\/2019\/06\/build-a-pwa-with-webpack-and-workbox\/"},"modified":"2019-06-27T04:19:20","modified_gmt":"2019-06-27T11:19:20","slug":"build-a-pwa-with-webpack-and-workbox","status":"publish","type":"post","link":"https:\/\/www.taterboy.com\/blog\/2019\/06\/build-a-pwa-with-webpack-and-workbox\/","title":{"rendered":"Build A PWA With Webpack And Workbox"},"content":{"rendered":"<link rel=\"canonical\" href=\"https:\/\/www.smashingmagazine.com\/2019\/06\/pwa-webpack-workbox\/\"><title>Build A PWA With Webpack And Workbox<\/title><\/p>\n<article>\n<header>\n<h1>Build A PWA With Webpack And Workbox<\/h1>\n<address>Jad Joubran<\/address>\n<p>                  <time datetime=\"2019-06-27T13:00:59+02:00\">2019-06-27T13:00:59+02:00<\/time><time datetime=\"2019-06-27T11:12:43+00:00\">2019-06-27T11:12:43+00:00<\/time><\/header>\n<p>A Progressive Web App (PWA) is a site that uses modern technology to deliver app-like experiences on the web. It\u2019s an umbrella term for new technologies such as the \u2018web app manifest\u2019, \u2018service worker\u2019, and more. When joined together, these technologies allow you to deliver fast and engaging user experiences with your website.<\/p>\n<p>This article is a step-by-step tutorial for adding a service worker to an existing one-page website. The service worker will allow you to make your website work offline while also notifying your users of updates to your site. Please note that this is based on a small project that is bundled with Webpack, so we\u2019ll be using the Workbox Webpack plugin (<a href=\"https:\/\/developers.google.com\/web\/tools\/workbox\/guides\/migrations\/migrate-from-v3\">Workbox v4<\/a>).<\/p>\n<p>Using a tool to generate your service worker is the recommended approach as it lets you manage your cache efficiently. We will be using <a href=\"https:\/\/github.com\/GoogleChrome\/workbox\">Workbox<\/a> \u2014 a set of libraries that make it easy to generate your service worker code \u2014 to generate our service worker in this tutorial.<\/p>\n<p>Depending on your project, you can use Workbox in three different ways:<\/p>\n<ol>\n<li>A <strong>command-line interface<\/strong> is available which lets you integrate workbox into any application you have;<\/li>\n<li>A <strong>Node.js module<\/strong> is available which lets you integrate workbox into any Node build tool such as gulp or grunt;<\/li>\n<li>A <strong>webpack plugin<\/strong> is available which lets you easily integrate with a project that is built with Webpack.<\/li>\n<\/ol>\n<p><a href=\"https:\/\/webpack.js.org\/\">Webpack<\/a> is a module bundler. To simplify, you can think of it as a tool that manages your JavaScript dependencies. It allows you to import JavaScript code from libraries and bundles your JavaScript together into one or many files.<\/p>\n<div data-component=\"FeaturePanel\" data-audience=\"non-subscriber\" data-remove=\"true\"><\/div>\n<p>To get started, clone the following repository on your computer:<\/p>\n<pre><code>git clone git@github.com:jadjoubran\/workbox-tutorial-v4.git\ncd workbox-tutorial-v4\nnpm install\nnpm run dev\n<\/code><\/pre>\n<p>Next, navigate to <code><a href=\"http:\/\/localhost:8080\/\">http:\/\/localhost:8080\/<\/a><\/code>. You should be able to see the currency app we\u2019ll be using throughout this tutorial:<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/123ef4ad-dc69-4cdc-ae1e-3b7e2dd41375\/our-app.png?ssl=1\"><\/p>\n<p>    <img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/pwa-webpack-workbox-our-app.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/27919a12-d279-45a4-beeb-4131ac6c690b\/pwa-webpack-workbox-our-app.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/27919a12-d279-45a4-beeb-4131ac6c690b\/pwa-webpack-workbox-our-app.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/27919a12-d279-45a4-beeb-4131ac6c690b\/pwa-webpack-workbox-our-app.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/27919a12-d279-45a4-beeb-4131ac6c690b\/pwa-webpack-workbox-our-app.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/pwa-webpack-workbox-our-app.png?w=900\" sizes=\"70vw\" alt=\"Screenshot of the currency app we\u2019re building in this article.\"><\/a><figcaption>\n      \u2018Currencies\u2019 is a PWA that lists conversion fees of currencies against the Euro (\u20ac) currency. (<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/123ef4ad-dc69-4cdc-ae1e-3b7e2dd41375\/our-app.png\">Large preview<\/a>)<br \/>\n    <\/figcaption><\/figure>\n<h3>Start With An App Shell<\/h3>\n<p>The <a href=\"https:\/\/developers.google.com\/web\/fundamentals\/architecture\/app-shell\">application shell<\/a> (or \u2018app shell\u2019) is a pattern inspired from Native Apps. It will help give your app a more native look. It simply provides the app with a layout and structure without any data \u2014 a transitional screen that is aimed to improve the loading experience of your web app.<\/p>\n<p>Here are some examples of app shells from native apps:<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/effb3dd1-f2e8-4b80-86da-e01490c4ba4a\/native-inbox-shell.png?ssl=1\"><\/p>\n<p>    <img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/pwa-webpack-workbox-native-inbox-shell.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/2a60e3e3-9c67-43e7-a204-6ba61dcbebd2\/pwa-webpack-workbox-native-inbox-shell.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/2a60e3e3-9c67-43e7-a204-6ba61dcbebd2\/pwa-webpack-workbox-native-inbox-shell.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/2a60e3e3-9c67-43e7-a204-6ba61dcbebd2\/pwa-webpack-workbox-native-inbox-shell.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/2a60e3e3-9c67-43e7-a204-6ba61dcbebd2\/pwa-webpack-workbox-native-inbox-shell.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/pwa-webpack-workbox-native-inbox-shell.png?w=900\" sizes=\"70vw\" alt=\"Google Inbox App Shell\"><\/a><figcaption>\n      Google Inbox App Shell: A few milliseconds before the emails load into the app shell. (<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/effb3dd1-f2e8-4b80-86da-e01490c4ba4a\/native-inbox-shell.png\">Large preview<\/a>)<br \/>\n    <\/figcaption><\/figure>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/379c934e-a1f1-425d-b152-3924c53097b8\/native-twitter-shell.png?ssl=1\"><\/p>\n<p>    <img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/pwa-webpack-workbox-native-twitter-shell.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/9788b3a0-4a59-46af-97a7-86ba8b469cba\/pwa-webpack-workbox-native-twitter-shell.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/9788b3a0-4a59-46af-97a7-86ba8b469cba\/pwa-webpack-workbox-native-twitter-shell.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/9788b3a0-4a59-46af-97a7-86ba8b469cba\/pwa-webpack-workbox-native-twitter-shell.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/9788b3a0-4a59-46af-97a7-86ba8b469cba\/pwa-webpack-workbox-native-twitter-shell.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/pwa-webpack-workbox-native-twitter-shell.png?w=900\" sizes=\"70vw\" alt=\"Twitter native App Shell\"><\/a><figcaption>\n      Twitter\u2019s native app on Android: App shell showing navbar, tabs, and loader. (<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/379c934e-a1f1-425d-b152-3924c53097b8\/native-twitter-shell.png\">Large preview<\/a>)<br \/>\n    <\/figcaption><\/figure>\n<p>And here are examples of app shells from PWAs:<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/0ae3c661-bf1f-4e6c-a6c0-44995b1a2f61\/pwa-twitter-shell.png?ssl=1\"><\/p>\n<p>    <img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/pwa-webpack-workbox-twitter-shell.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/561e0383-264c-4306-9491-9899e3cd5051\/pwa-webpack-workbox-twitter-shell.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/561e0383-264c-4306-9491-9899e3cd5051\/pwa-webpack-workbox-twitter-shell.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/561e0383-264c-4306-9491-9899e3cd5051\/pwa-webpack-workbox-twitter-shell.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/561e0383-264c-4306-9491-9899e3cd5051\/pwa-webpack-workbox-twitter-shell.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/pwa-webpack-workbox-twitter-shell.png?w=900\" sizes=\"70vw\" alt=\"App Shell of Twitter\u2019s PWA\"><\/a><figcaption>\n      The app shell of Twitter\u2019s PWA (<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/0ae3c661-bf1f-4e6c-a6c0-44995b1a2f61\/pwa-twitter-shell.png\">Large preview<\/a>)<br \/>\n    <\/figcaption><\/figure>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/5f4888b4-9760-472e-948b-0b18d917ca50\/pwa-flipkart-shell.png?ssl=1\"><\/p>\n<p>    <img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/pwa-webpack-workbox-flipkart-shell.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/e4f84167-cad6-44a5-b20c-d5d632b092eb\/pwa-webpack-workbox-flipkart-shell.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/e4f84167-cad6-44a5-b20c-d5d632b092eb\/pwa-webpack-workbox-flipkart-shell.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/e4f84167-cad6-44a5-b20c-d5d632b092eb\/pwa-webpack-workbox-flipkart-shell.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/e4f84167-cad6-44a5-b20c-d5d632b092eb\/pwa-webpack-workbox-flipkart-shell.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/pwa-webpack-workbox-flipkart-shell.png?w=900\" sizes=\"70vw\" alt=\"App Shell of Flipkart\u2019s PWA\"><\/a><figcaption>\n      The app shell of Flipkart\u2019s PWA (<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/5f4888b4-9760-472e-948b-0b18d917ca50\/pwa-flipkart-shell.png\">Large preview<\/a>)<br \/>\n    <\/figcaption><\/figure>\n<p>Users like the loading experience of app shells because they despise blank screens. A blank screen makes the user feel that the website is not loading. It makes them feel as if the website were stuck.<\/p>\n<p>App shells attempt to paint the navigational structure of the app as soon as possible, such as the navbar, the tab bar as well as a loader signifying that the content you\u2019ve requested is being loaded.<\/p>\n<div><\/div>\n<h4>So How Do You Build An App Shell?<\/h4>\n<p>The app shell pattern prioritizes the loading of the HTML, CSS and JavaScript that will render first. This means that we need to give those resources full priority, hence you have to inline those assets. So to build an app shell, you simply have to inline the HTML, CSS and JavaScript that are responsible for the app shell. Of course, you should not inline everything but rather stay within a limit of around 30 to 40KB total.<\/p>\n<p>You can see the inlined app shell in the <em>index.html<\/em>. You can inspect the source code by checking out the <em>index.html<\/em> file, and you can preview it in the browser by deleting the <code><main><\/code> element in dev tools:<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/00d178c3-61a2-4332-998c-d97cdf9af843\/our-app-shell.png?ssl=1\"><\/p>\n<p>    <img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/pwa-webpack-workbox-our-app-shell.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/437fec6e-6172-4ba6-ab30-0a2f672491fb\/pwa-webpack-workbox-our-app-shell.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/437fec6e-6172-4ba6-ab30-0a2f672491fb\/pwa-webpack-workbox-our-app-shell.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/437fec6e-6172-4ba6-ab30-0a2f672491fb\/pwa-webpack-workbox-our-app-shell.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/437fec6e-6172-4ba6-ab30-0a2f672491fb\/pwa-webpack-workbox-our-app-shell.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/pwa-webpack-workbox-our-app-shell.png?w=900\" sizes=\"70vw\" alt=\"Currencies PWA App Shell with navbar &#038; loader\"><\/a><figcaption>\n      The App Shell that we\u2019re building in this article. (<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/00d178c3-61a2-4332-998c-d97cdf9af843\/our-app-shell.png\">Large preview<\/a>)<br \/>\n    <\/figcaption><\/figure>\n<h3>Does It Work Offline?<\/h3>\n<p>Let\u2019s simulate going offline! Open DevTools, navigate to the network tab and tick the \u2018Offline\u2019 checkbox. When you reload the page, you will see that we will get the browser\u2019s offline page.<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/3e1b20d3-9e96-4416-98ab-ffad20591f20\/offline1.png?ssl=1\"><\/p>\n<p>    <img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/pwa-webpack-workbox-offline1.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/ae7304e9-dbfb-4511-9e0c-7ea6c260018a\/pwa-webpack-workbox-offline1.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/ae7304e9-dbfb-4511-9e0c-7ea6c260018a\/pwa-webpack-workbox-offline1.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/ae7304e9-dbfb-4511-9e0c-7ea6c260018a\/pwa-webpack-workbox-offline1.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/ae7304e9-dbfb-4511-9e0c-7ea6c260018a\/pwa-webpack-workbox-offline1.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/pwa-webpack-workbox-offline1.png?w=900\" sizes=\"70vw\" alt=\"Browser\u2019s offline error page\"><\/a><figcaption>\n      The request to the homepage failed so we obviously see this as a result. (<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/3e1b20d3-9e96-4416-98ab-ffad20591f20\/offline1.png\">Large preview<\/a>)<br \/>\n    <\/figcaption><\/figure>\n<p>That\u2019s because the initial request to <code>\/<\/code> (which will load the <em>index.html<\/em> file) will fail because the Internet is offline. The only way for us to recover from that request failure is by having a service worker.<\/p>\n<p>Let\u2019s visualize the request without a service worker:<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/405f41cd-6a27-466d-a115-d901d951b301\/without-sw.gif?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/without-sw-800w.gif?w=800\"   alt=\"Animation of a network request going from the client\u2019s browser to the internet.\"><\/a><figcaption>Network request goes from the browser to the Internet and back. (Icons from <a href=\"https:\/\/www.flaticon.com\/\">flaticon.com<\/a>) (<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/405f41cd-6a27-466d-a115-d901d951b301\/without-sw.gif\">Large preview<\/a>)<\/figcaption><\/figure>\n<p>A service worker is a programmable network proxy, which means it sits in between your web page and the Internet. This lets you control incoming and outgoing network requests.<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/c6ad80a2-5990-473c-8fbe-8dc6670f5ff0\/with-sw.gif?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/with-sw-800w.gif?w=800\"   alt=\"Animation of a network request intercepted by the service worker.\"><\/a><figcaption>Network request gets intercepted by the service worker. (Icons from <a href=\"https:\/\/www.flaticon.com\/\">flaticon.com<\/a>) (<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/c6ad80a2-5990-473c-8fbe-8dc6670f5ff0\/with-sw.gif\">Large preview<\/a>)<\/figcaption><\/figure>\n<p>This is beneficial because we can now re-route this failed request to the cache (assuming we have the content in the cache).<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/94f5c376-d229-4dc7-b659-21eee27285ed\/with-sw-cache.gif?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/with-sw-cache-800w.gif?w=800\"   alt=\"Animation of a network request interecepted by the service worker and redirected to the cache.\"><\/a><figcaption>Network request gets redirected to the cache when it already exists in the cache. (Icons from <a href=\"https:\/\/www.flaticon.com\/\">flaticon.com<\/a>) (<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/94f5c376-d229-4dc7-b659-21eee27285ed\/with-sw-cache.gif\">Large preview<\/a>)<\/figcaption><\/figure>\n<p>A service worker is also a type of Web Worker, meaning that it runs separately from your main page and doesn\u2019t have access to either the <code>window<\/code> or <code>document<\/code> object.<\/p>\n<div><\/div>\n<h3>Precache The App Shell<\/h3>\n<p>In order to make our app work offline, we\u2019re going to start by precaching the app shell.<\/p>\n<p>So let\u2019s start by installing the Webpack Workbox plugin:<\/p>\n<pre><code>npm install --save-dev workbox-webpack-plugin\n<\/code><\/pre>\n<p>Then we\u2019re going to open our <em>index.js<\/em> file and register the service worker:<\/p>\n<pre><code>if (\"serviceWorker\" in navigator){\nwindow.addEventListener(\"load\", () => {\nnavigator.serviceWorker.register(\"\/sw.js\");\n})\n}\n<\/code><\/pre>\n<p>Next, open the <em>webpack.config.js<\/em> file and let\u2019s configure the Workbox webpack plugin:<\/p>\n<pre><code>\/\/add at the top\nconst WorkboxWebpackPlugin = require(\"workbox-webpack-plugin\");\n\n\/\/add inside the plugins array:\nplugins: [\n\u2026\n, new WorkboxWebpackPlugin.InjectManifest({\n  swSrc: \".\/src\/src-sw.js\",\n  swDest: \"sw.js\"\n})\n]\n<\/code><\/pre>\n<p>This will instruct Workbox to use our <em>.\/src\/src-sw.js<\/em> file as a base. The generated file will be called <em>sw.js<\/em> and will be in the <code>dist<\/code> folder.<\/p>\n<p>Then create a <em>.\/src\/src-sw.js<\/em> file at the root level and write the following inside of it:<\/p>\n<pre><code>workbox.precaching.precacheAndRoute(self.__precacheManifest);\n<\/code><\/pre>\n<p><strong>Note<\/strong>: <em>The<\/em> <code>self.__precacheManifest<\/code> <em>variable will be imported from a file that will be dynamically generated by workbox.<\/em><\/p>\n<p>Now you\u2019re ready to build your code with <code>npm run build<\/code> and Workbox will generate two files inside the <code>dist<\/code> folder:<\/p>\n<ul>\n<li><em>precache-manifest.66cf63077c7e4a70ba741ee9e6a8da29.js<\/em><\/li>\n<li><em>sw.js<\/em><\/li>\n<\/ul>\n<p>The <em>sw.js<\/em> imports workbox from CDN as well as the <em>precache-manifest.[chunkhash].js<\/em>.<\/p>\n<pre><code>\/\/precache-manifest.[chunkhash].js file\nself.__precacheManifest = (self.__precacheManifest || []).concat([\n  \n    \"revision\": \"ba8f7488757693a5a5b1e712ac29cc28\",\n    \"url\": \"index.html\"\n  },\n  \n    \"url\": \"main.49467c51ac5e0cb2b58e.js\"\n  \n]);\n<\/code><\/pre>\n<p>The precache manifest lists the names of the files that were processed by webpack and that end up in your <code>dist<\/code> folder. We will use these files to precache them in the browser. This means that when your website loads the first time and registers the service worker, it will cache these assets so that they can be used the next time.<\/p>\n<p>You can also notice that some entries have a \u2018revision\u2019 whereas others don\u2019t. That\u2019s because the revision can sometimes be inferred from the chunkhash from the file name. For example, let\u2019s take a closer look at the file name <em>main.49467c51ac5e0cb2b58e.js<\/em>. It has a revision is in the filename, which is the chunkhash <em>49467c51ac5e0cb2b58e<\/em>.<\/p>\n<p>This allows Workbox to understand when your files change so that it only cleans up or updates the files that were changed, rather than dumping all the cache every time you publish a new version of your service worker.<\/p>\n<p>The first time you load the page, the service worker will install. You can see that in DevTools. First, the <em>sw.js<\/em> file is requested which then requests all the other files. They are clearly marked with the gear icon.<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/498a146e-27f0-421d-bb6b-909807d15e85\/sw-network-tab.png?ssl=1\"><\/p>\n<p>    <img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/sw-network-tab.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/498a146e-27f0-421d-bb6b-909807d15e85\/sw-network-tab.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/498a146e-27f0-421d-bb6b-909807d15e85\/sw-network-tab.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/498a146e-27f0-421d-bb6b-909807d15e85\/sw-network-tab.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/498a146e-27f0-421d-bb6b-909807d15e85\/sw-network-tab.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/sw-network-tab.png?w=900\" sizes=\"100vw\" alt=\"Screenshot of DevTools Network tab when the service worker gets installed.\"><\/a><figcaption>\n      Requests marked with the ?? icon are requests initiated by the service worker. (<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/498a146e-27f0-421d-bb6b-909807d15e85\/sw-network-tab.png\">Large preview<\/a>)<br \/>\n    <\/figcaption><\/figure>\n<p>So Workbox will initialize and it will precache all the files that are in the precache-manifest. It is important to double check that you don\u2019t have any unnecessary files in the <em>precache-manifest<\/em> file such as <em>.map<\/em> files or files that are not part of the app shell.<\/p>\n<p>In the network tab, we can see the requests coming from the service worker. And now if you try to go offline, the app shell is already precached so it works even if we\u2019re offline!<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/3b0b90c0-0c0b-4949-951d-ce4f9d8e7a0b\/offline-network-fail.png?ssl=1\"><\/p>\n<p>    <img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/offline-network-fail.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/3b0b90c0-0c0b-4949-951d-ce4f9d8e7a0b\/offline-network-fail.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/3b0b90c0-0c0b-4949-951d-ce4f9d8e7a0b\/offline-network-fail.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/3b0b90c0-0c0b-4949-951d-ce4f9d8e7a0b\/offline-network-fail.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/3b0b90c0-0c0b-4949-951d-ce4f9d8e7a0b\/offline-network-fail.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/offline-network-fail.png?w=900\" sizes=\"100vw\" alt=\"Screenshot of Dev Tools Network tab showing API calls failing.\"><\/a><figcaption>\n      API calls fail when we go offline. (<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/3b0b90c0-0c0b-4949-951d-ce4f9d8e7a0b\/offline-network-fail.png\">Large preview<\/a>)<br \/>\n    <\/figcaption><\/figure>\n<h3>Cache Dynamic Routes<\/h3>\n<p>Did you notice that when we went offline, the app shell works but not our data? That\u2019s because these API calls are not part of the <strong>precached app shell<\/strong>. When there\u2019s no Internet connection, these requests will fail and the user won\u2019t be able to see the currency information.<\/p>\n<p>However, these requests cannot be precached because their value comes from an API. Moreover, when you start having multiple pages, you don\u2019t want to cache all API request in one go. Instead, you want to cache them when the user visits that page.<\/p>\n<p>We call these \u2018dynamic data\u2019. They often include API calls as well as images and other assets that are requested when a user does a certain action on your website (e.g. when they browse to a new page).<\/p>\n<p>You can cache these using Workbox\u2019s routing module. Here\u2019s how:<\/p>\n<pre><code>\/\/add in src\/src-sw.js\nworkbox.routing.registerRoute(\n  \/https:\/\/api.exchangeratesapi.io\/latest\/,\n  new workbox.strategies.NetworkFirst({\n    cacheName: \"currencies\",\n    plugins: [\n      new workbox.expiration.Plugin({\n        maxAgeSeconds: 10 * 60 \/\/ 10 minutes\n      })\n    \n  })\n);\n<\/code><\/pre>\n<p>This will set up dynamic caching for any request URL that matches the URL <code><a href=\"https:\/\/api.exchangeratesapi.io\/latest\">https:\/\/api.exchangeratesapi.io\/latest<\/a><\/code>.<\/p>\n<p>The caching strategy that we used here is called <code>NetworkFirst<\/code>; there are two other ones that are often used:<\/p>\n<ol>\n<li><code>CacheFirst<\/code><\/li>\n<li><code>StaleWhileRevalidate<\/code><\/li>\n<\/ol>\n<p><code>CacheFirst<\/code> will look for it in the cache first. If it\u2019s not found, then it will get it from the network. <code>StaleWhileRevalidate<\/code> will go to the network and the cache at the same time. Return the cache\u2019s response to the page (while in the background) it will use the new network response to update the cache for the next time it\u2019s used.<\/p>\n<p>For our use case, we had to go with <code>NetworkFirst<\/code> because we\u2019re dealing with currency rates that change very often. However, when the user goes offline, we can at least show them the rates as they were 10 minutes ago \u2014 that\u2019s why we used the expiration plugin with the <code>maxAgeSeconds<\/code> set to <code>10 * 60<\/code> seconds.<\/p>\n<h3>Manage App Updates<\/h3>\n<p>Everytime a user loads your page, the browser will run the <code>navigator.serviceWorker.register<\/code> code even though the service worker is already installed and running. This allows the browser to detect if there\u2019s a new version of the service worker. When the browser notices that the file has not changed, it just skips the registration call. Once that file changes, the browser understands that there\u2019s a new version of the service worker, thus <strong>it installs the new service worker parallel to the currently running service worker<\/strong>.<\/p>\n<p>However, it pauses at the <code>installed\/waiting<\/code> phase because only one service worker can be activated at the same time.<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/e4840a43-76ed-4848-a988-b714032d8554\/sw-life-cycle.png?ssl=1\"><\/p>\n<p>    <img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/sw-life-cycle.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/e4840a43-76ed-4848-a988-b714032d8554\/sw-life-cycle.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/e4840a43-76ed-4848-a988-b714032d8554\/sw-life-cycle.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/e4840a43-76ed-4848-a988-b714032d8554\/sw-life-cycle.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/e4840a43-76ed-4848-a988-b714032d8554\/sw-life-cycle.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/sw-life-cycle.png?w=900\" sizes=\"100vw\" alt=\"The life cycle of a service worker: Parsed, Installed\/Waiting, Activated &#038; Redundant\"><\/a><figcaption>\n      A simplified life cycle of a service worker (<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/e4840a43-76ed-4848-a988-b714032d8554\/sw-life-cycle.png\">Large preview<\/a>)<br \/>\n    <\/figcaption><\/figure>\n<p>Only when all the browser windows controlled by the previous service worker are installed, then it becomes safe for the new service worker to activate.<\/p>\n<p>You can also manually control that by calling <code>skipWaiting()<\/code> (or <code>self.skipWaiting()<\/code> since <code>self<\/code> is the global execution context in the service worker). However, most of the time you should only do that after asking the user if they want to get the latest update.<\/p>\n<p>Thankfully, <code>workbox-window<\/code> helps us achieve this. It\u2019s a new window library introduced in Workbox v4 that aims at simplifying common tasks on the window\u2019s side.<\/p>\n<p>Let\u2019s start by installing it with the following:<\/p>\n<pre><code>npm install workbox-window\n<\/code><\/pre>\n<p>Next, import <code>Workbox<\/code> at the top of the file <em>index.js<\/em>:<\/p>\n<pre><code>import { Workbox } from \"workbox-window\";\n<\/code><\/pre>\n<p>Then we\u2019ll replace our registration code with the below:<\/p>\n<pre><code>if (\"serviceWorker\" in navigator) {\n  window.addEventListener(\"load\", () => {\n      const wb = new Workbox(\"\/sw.js\");\n    \nwb.register();\n  });\n\n}\n<\/code><\/pre>\n<p>We\u2019ll then find the update button which has the ID <cpde>app-update<\/cpde> and listen for the <code>workbox-waiting<\/code> event:<\/p>\n<div>\n<pre><code>\/\/add before the wb.register()\nconst updateButton = document.querySelector(\"#app-update\");\n\/\/ Fires when the registered service worker has installed but is waiting to activate.\nwb.addEventListener(\"waiting\", event => {\n    updateButton.classList.add(\"show\");\n    updateButton.addEventListener(\"click\", () => {\n    \/\/ Set up a listener that will reload the page as soon as the previously waiting service worker has taken control.\n    wb.addEventListener(\"controlling\", event => {\n        window.location.reload();\n    });\n\n    \/\/ Send a message telling the service worker to skip waiting.\n    \/\/ This will trigger the `controlling` event handler above.\n    wb.messageSW({ type: \"SKIP_WAITING\" });\n    });\n});\n<\/code><\/pre>\n<\/div>\n<p>This code will show the update button when there\u2019s a new update (so when the service worker is in a waiting state) and will send a <code>SKIP_WAITING<\/code> message to the service worker.<\/p>\n<p>We\u2019ll need update the service worker file and handle the <code>SKIP_WAITING<\/code> event such that it calls the <code>skipWaiting<\/code>:<\/p>\n<pre><code>\/\/add in src-sw.js\naddEventListener(\"message\", event => {\n  if (event.data && event.data.type === \"SKIP_WAITING\") {\n    skipWaiting();\n  \n});\n<\/code><\/pre>\n<p>Now run <code>npm run dev<\/code> then reload the page. Go into your code and update the navbar title to \u201cNavbar v2\u201d. Reload the page again, and you should be able to see the update icon.<\/p>\n<h3>Wrapping Up<\/h3>\n<p>Our website now works offline and is able to tell the user about new updates. Please keep in mind though, that the most important factor when building a PWA is the user experience. Always focus on building experiences that are easy to use by your users. We, as developers, tend to get too excited about technology and often end up forgetting about our users.<\/p>\n<p>If you\u2019d like to take this a step further, you can add a web app manifest which will allow your users to add the site to their home screen. And if you\u2019d like to know more about Workbox, you can find the official documentation on the <a href=\"https:\/\/workboxjs.org\/\">Workbox<\/a> website.<\/p>\n<h4><span>Further Reading<\/span> on SmashingMag:<\/h4>\n<ul>\n<li><a title=\"Read 'Can You Make More Money With A Mobile App Or A PWA?'\" href=\"https:\/\/www.smashingmagazine.com\/2019\/03\/can-you-make-more-money-with-mobile-app-or-a-pwa\/\" rel=\"bookmark\">Can You Make More Money With A Mobile App Or A PWA?<\/a><\/li>\n<li><a title=\"Read 'An Extensive Guide To Progressive Web Applications'\" href=\"https:\/\/www.smashingmagazine.com\/2018\/11\/guide-pwa-progressive-web-applications\/\" rel=\"bookmark\">An Extensive Guide To Progressive Web Applications<\/a><\/li>\n<li><a title=\"Read 'Native And PWA: Choices, Not Challengers!'\" href=\"https:\/\/www.smashingmagazine.com\/2018\/02\/native-and-pwa-choices-not-challengers\/\" rel=\"bookmark\">Native And PWA: Choices, Not Challengers!<\/a><\/li>\n<li><a title=\"Read 'Building A PWA Using Angular 6'\" href=\"https:\/\/www.smashingmagazine.com\/2018\/09\/pwa-angular-6\/\" rel=\"bookmark\">Building A PWA Using Angular 6<\/a><\/li>\n<\/ul>\n<div>\n  <img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/logo-red-19.png?w=900\" alt=\"Smashing Editorial\"><span>(dm, yk, il)<\/span>\n<\/div>\n<\/article>\n<p class=\"wpematico_credit\"><small>Powered by <a href=\"http:\/\/www.wpematico.com\" target=\"_blank\">WPeMatico<\/a><\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Build A PWA With Webpack And Workbox Build A PWA With Webpack And Workbox Jad Joubran 2019-06-27T13:00:59+02:002019-06-27T11:12:43+00:00 A Progressive Web App (PWA) is a site that uses modern technology to deliver app-like experiences on the web. It\u2019s an umbrella term for new technologies such as the \u2018web app manifest\u2019, \u2018service worker\u2019, and more. When joined&#8230;<a class=\"moretag\" href=\"https:\/\/www.taterboy.com\/blog\/2019\/06\/build-a-pwa-with-webpack-and-workbox\/\"> Read the full article&#8230;<\/a><\/p>\n","protected":false},"author":4,"featured_media":67392,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[371],"tags":[],"class_list":["post-67391","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-user-experience"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Build A PWA With Webpack And WorkboxBuild A PWA With Webpack And Workbox Jad Joubran 2019-06-27T13:00:59+02:002019-06-27T11:12:43+00:00A Progressive Web App (PWA) is a site that uses modern technology to deliver app-like experiences on the web. It\u2019s an umbrella term for new technologies such as the \u2018web app manifest\u2019, \u2018service worker\u2019, and more. When joined together, these\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Guest Contribution\"\/>\n\t<meta name=\"keywords\" content=\"user experience\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.taterboy.com\/blog\/2019\/06\/build-a-pwa-with-webpack-and-workbox\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Design for Immersive Technologies | User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Build A PWA With Webpack And Workbox | Design for Immersive Technologies\" \/>\n\t\t<meta property=\"og:description\" content=\"Build A PWA With Webpack And WorkboxBuild A PWA With Webpack And Workbox Jad Joubran 2019-06-27T13:00:59+02:002019-06-27T11:12:43+00:00A Progressive Web App (PWA) is a site that uses modern technology to deliver app-like experiences on the web. It\u2019s an umbrella term for new technologies such as the \u2018web app manifest\u2019, \u2018service worker\u2019, and more. When joined together, these\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.taterboy.com\/blog\/2019\/06\/build-a-pwa-with-webpack-and-workbox\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-06-27T11:19:20+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-06-27T11:19:20+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Build A PWA With Webpack And Workbox | Design for Immersive Technologies\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Build A PWA With Webpack And WorkboxBuild A PWA With Webpack And Workbox Jad Joubran 2019-06-27T13:00:59+02:002019-06-27T11:12:43+00:00A Progressive Web App (PWA) is a site that uses modern technology to deliver app-like experiences on the web. It\u2019s an umbrella term for new technologies such as the \u2018web app manifest\u2019, \u2018service worker\u2019, and more. When joined together, these\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/06\\\/build-a-pwa-with-webpack-and-workbox\\\/#article\",\"name\":\"Build A PWA With Webpack And Workbox | Design for Immersive Technologies\",\"headline\":\"Build A PWA With Webpack And Workbox\",\"author\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.taterboy.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/pwa-webpack-workbox-our-app.png?fit=400%2C307&ssl=1\",\"width\":400,\"height\":307},\"datePublished\":\"2019-06-27T04:19:20-07:00\",\"dateModified\":\"2019-06-27T04:19:20-07:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/06\\\/build-a-pwa-with-webpack-and-workbox\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/06\\\/build-a-pwa-with-webpack-and-workbox\\\/#webpage\"},\"articleSection\":\"User Experience\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/06\\\/build-a-pwa-with-webpack-and-workbox\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.taterboy.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/category\\\/user-experience\\\/#listItem\",\"name\":\"User Experience\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/category\\\/user-experience\\\/#listItem\",\"position\":2,\"name\":\"User Experience\",\"item\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/category\\\/user-experience\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/06\\\/build-a-pwa-with-webpack-and-workbox\\\/#listItem\",\"name\":\"Build A PWA With Webpack And Workbox\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/06\\\/build-a-pwa-with-webpack-and-workbox\\\/#listItem\",\"position\":3,\"name\":\"Build A PWA With Webpack And Workbox\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/category\\\/user-experience\\\/#listItem\",\"name\":\"User Experience\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#organization\",\"name\":\"Design for Immersive Technologies\",\"description\":\"User Experience for Games, Virtual Reality (VR) and Augmented\\\/Mixed Reality (AR\\\/MR)\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/\",\"name\":\"Guest Contribution\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/06\\\/build-a-pwa-with-webpack-and-workbox\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d2aad73eb0f48c67b141e9fc978a0e498969791ed623346e361d02d19775b0bb?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Guest Contribution\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/06\\\/build-a-pwa-with-webpack-and-workbox\\\/#webpage\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/06\\\/build-a-pwa-with-webpack-and-workbox\\\/\",\"name\":\"Build A PWA With Webpack And Workbox | Design for Immersive Technologies\",\"description\":\"Build A PWA With Webpack And WorkboxBuild A PWA With Webpack And Workbox Jad Joubran 2019-06-27T13:00:59+02:002019-06-27T11:12:43+00:00A Progressive Web App (PWA) is a site that uses modern technology to deliver app-like experiences on the web. It\\u2019s an umbrella term for new technologies such as the \\u2018web app manifest\\u2019, \\u2018service worker\\u2019, and more. When joined together, these\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/06\\\/build-a-pwa-with-webpack-and-workbox\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.taterboy.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/pwa-webpack-workbox-our-app.png?fit=400%2C307&ssl=1\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/06\\\/build-a-pwa-with-webpack-and-workbox\\\/#mainImage\",\"width\":400,\"height\":307},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/06\\\/build-a-pwa-with-webpack-and-workbox\\\/#mainImage\"},\"datePublished\":\"2019-06-27T04:19:20-07:00\",\"dateModified\":\"2019-06-27T04:19:20-07:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/\",\"name\":\"Design for Immersive Technologies\",\"description\":\"User Experience for Games, Virtual Reality (VR) and Augmented\\\/Mixed Reality (AR\\\/MR)\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Build A PWA With Webpack And Workbox | Design for Immersive Technologies","description":"Build A PWA With Webpack And WorkboxBuild A PWA With Webpack And Workbox Jad Joubran 2019-06-27T13:00:59+02:002019-06-27T11:12:43+00:00A Progressive Web App (PWA) is a site that uses modern technology to deliver app-like experiences on the web. It\u2019s an umbrella term for new technologies such as the \u2018web app manifest\u2019, \u2018service worker\u2019, and more. When joined together, these","canonical_url":"https:\/\/www.taterboy.com\/blog\/2019\/06\/build-a-pwa-with-webpack-and-workbox\/","robots":"max-image-preview:large","keywords":"user experience","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.taterboy.com\/blog\/2019\/06\/build-a-pwa-with-webpack-and-workbox\/#article","name":"Build A PWA With Webpack And Workbox | Design for Immersive Technologies","headline":"Build A PWA With Webpack And Workbox","author":{"@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author"},"publisher":{"@id":"https:\/\/www.taterboy.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/pwa-webpack-workbox-our-app.png?fit=400%2C307&ssl=1","width":400,"height":307},"datePublished":"2019-06-27T04:19:20-07:00","dateModified":"2019-06-27T04:19:20-07:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.taterboy.com\/blog\/2019\/06\/build-a-pwa-with-webpack-and-workbox\/#webpage"},"isPartOf":{"@id":"https:\/\/www.taterboy.com\/blog\/2019\/06\/build-a-pwa-with-webpack-and-workbox\/#webpage"},"articleSection":"User Experience"},{"@type":"BreadcrumbList","@id":"https:\/\/www.taterboy.com\/blog\/2019\/06\/build-a-pwa-with-webpack-and-workbox\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.taterboy.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/#listItem","name":"User Experience"}},{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/#listItem","position":2,"name":"User Experience","item":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/2019\/06\/build-a-pwa-with-webpack-and-workbox\/#listItem","name":"Build A PWA With Webpack And Workbox"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/2019\/06\/build-a-pwa-with-webpack-and-workbox\/#listItem","position":3,"name":"Build A PWA With Webpack And Workbox","previousItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/#listItem","name":"User Experience"}}]},{"@type":"Organization","@id":"https:\/\/www.taterboy.com\/blog\/#organization","name":"Design for Immersive Technologies","description":"User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)","url":"https:\/\/www.taterboy.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author","url":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/","name":"Guest Contribution","image":{"@type":"ImageObject","@id":"https:\/\/www.taterboy.com\/blog\/2019\/06\/build-a-pwa-with-webpack-and-workbox\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/d2aad73eb0f48c67b141e9fc978a0e498969791ed623346e361d02d19775b0bb?s=96&d=mm&r=g","width":96,"height":96,"caption":"Guest Contribution"}},{"@type":"WebPage","@id":"https:\/\/www.taterboy.com\/blog\/2019\/06\/build-a-pwa-with-webpack-and-workbox\/#webpage","url":"https:\/\/www.taterboy.com\/blog\/2019\/06\/build-a-pwa-with-webpack-and-workbox\/","name":"Build A PWA With Webpack And Workbox | Design for Immersive Technologies","description":"Build A PWA With Webpack And WorkboxBuild A PWA With Webpack And Workbox Jad Joubran 2019-06-27T13:00:59+02:002019-06-27T11:12:43+00:00A Progressive Web App (PWA) is a site that uses modern technology to deliver app-like experiences on the web. It\u2019s an umbrella term for new technologies such as the \u2018web app manifest\u2019, \u2018service worker\u2019, and more. When joined together, these","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.taterboy.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.taterboy.com\/blog\/2019\/06\/build-a-pwa-with-webpack-and-workbox\/#breadcrumblist"},"author":{"@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author"},"creator":{"@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/pwa-webpack-workbox-our-app.png?fit=400%2C307&ssl=1","@id":"https:\/\/www.taterboy.com\/blog\/2019\/06\/build-a-pwa-with-webpack-and-workbox\/#mainImage","width":400,"height":307},"primaryImageOfPage":{"@id":"https:\/\/www.taterboy.com\/blog\/2019\/06\/build-a-pwa-with-webpack-and-workbox\/#mainImage"},"datePublished":"2019-06-27T04:19:20-07:00","dateModified":"2019-06-27T04:19:20-07:00"},{"@type":"WebSite","@id":"https:\/\/www.taterboy.com\/blog\/#website","url":"https:\/\/www.taterboy.com\/blog\/","name":"Design for Immersive Technologies","description":"User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.taterboy.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Design for Immersive Technologies | User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)","og:type":"article","og:title":"Build A PWA With Webpack And Workbox | Design for Immersive Technologies","og:description":"Build A PWA With Webpack And WorkboxBuild A PWA With Webpack And Workbox Jad Joubran 2019-06-27T13:00:59+02:002019-06-27T11:12:43+00:00A Progressive Web App (PWA) is a site that uses modern technology to deliver app-like experiences on the web. It\u2019s an umbrella term for new technologies such as the \u2018web app manifest\u2019, \u2018service worker\u2019, and more. When joined together, these","og:url":"https:\/\/www.taterboy.com\/blog\/2019\/06\/build-a-pwa-with-webpack-and-workbox\/","article:published_time":"2019-06-27T11:19:20+00:00","article:modified_time":"2019-06-27T11:19:20+00:00","twitter:card":"summary","twitter:title":"Build A PWA With Webpack And Workbox | Design for Immersive Technologies","twitter:description":"Build A PWA With Webpack And WorkboxBuild A PWA With Webpack And Workbox Jad Joubran 2019-06-27T13:00:59+02:002019-06-27T11:12:43+00:00A Progressive Web App (PWA) is a site that uses modern technology to deliver app-like experiences on the web. It\u2019s an umbrella term for new technologies such as the \u2018web app manifest\u2019, \u2018service worker\u2019, and more. When joined together, these"},"aioseo_meta_data":{"post_id":"67391","title":null,"description":null,"keywords":null,"keyphrases":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_custom_image_width":null,"og_custom_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"created":"2021-02-07 19:14:30","updated":"2026-09-01 13:08:25","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"primary_term":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"twitter_image_url":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.taterboy.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/\" title=\"User Experience\">User Experience<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tBuild A PWA With Webpack And Workbox\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.taterboy.com\/blog"},{"label":"User Experience","link":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/"},{"label":"Build A PWA With Webpack And Workbox","link":"https:\/\/www.taterboy.com\/blog\/2019\/06\/build-a-pwa-with-webpack-and-workbox\/"}],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8wzr5-hwX","jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/06\/pwa-webpack-workbox-our-app.png?fit=400%2C307&ssl=1","_links":{"self":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/posts\/67391","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/comments?post=67391"}],"version-history":[{"count":0,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/posts\/67391\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/media\/67392"}],"wp:attachment":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/media?parent=67391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/categories?post=67391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/tags?post=67391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}