Skip to content

Instantly share code, notes, and snippets.

@DSchau
Created April 9, 2022 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DSchau/27967b93c20dc2b901078d7656b3c901 to your computer and use it in GitHub Desktop.
Save DSchau/27967b93c20dc2b901078d7656b3c901 to your computer and use it in GitHub Desktop.
Caching with a Plugin

Instructions

  1. Check out the caching repo
  2. Push to Gatsby Cloud
  3. First build will log "Cache not persisted, getting new characters"
  4. Subsequent builds will not
    • Can validate with a builds webhook invocation: curl -X POST https://webhook.gatsbyjs.com/hooks/data_source/publish/0f86ced9-2fa3-4738-80d8-23786226a8f3

Note: there are several conditions in which the cache is (automatically) cleared. They are documented in the cache API docs.

First Build

Screen Shot 2022-04-09 at 13 46 46

Screen Shot 2022-04-09 at 13 50 34

Subsequent Builds

Screen Shot 2022-04-09 at 13 50 52

Screen Shot 2022-04-09 at 13 50 41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment