• Caching our content
  • Using manifest and offline plugins from gatsby
  • We need API Calls

    • How to do our API Calls
  • Caching our video

In the last episode, we built the starting point of our PWA at DailyDrip. We are showing hardcoded data. We have the Drip content hardcoded and the Video URL. We are using Grommet with Gatsby.

Today we will cache the content, and make the API calls to our API.

Here is our API call. It returns a JSON with the content description, title, and the video URL. Everything we want. This requests should pass a token in the header.

Gatsby has some plugins to help our life as we saw before. We will use the Gatsby offline plugin to cache our data, it uses sw-precache. And we will use gatsby manifest plugin, to help us manage our manifest.json.

Let's add them as libraries.

yarn add gatsby-plugin-manifest

And

yarn add gatsby-plugin-offline

Now, we can set up and customize these plugins in our gatsby configuration file.

vim gatsby-config.js

We will add them in the plugins...