DEV Community

DE{CODE}

WPGraphQL Smart Cache with Jason Bahl

In this episode, Fran and Jeff catch up with Jason Bahl, the creator of WPGraphQL to discuss a new caching extension for WPGraphQL. Jason is a figure in the headless WordPress ecosystem that likely needs no introduction, but the group discusses some of their early experiences with headless WordPress.

WPGraphQL Smart Cache makes a user's GraphQL queries more efficient by providing network and object caching layer options for users using the plugin. Jason explains a ton of interesting technical details about the caching implementations. He digs into the following things:

  • Using GET/POST requests with network requests 
  • How cache invalidation works in this plugin in a nuanced way
  • How Smart Cache can work with framework rendering patterns
  • What other hosting companies can do to enable WPGraphQL Smart Cache on their platform
  • How object caching works in the plugin if you can't integrate with a network hosting layer
  • How a new feature called persisted queries allows you to store your queries on the server, like a SQL stored procedure
  • Considerations for people using plugins or extensions to store custom data

Check out the plugin in WordPress plugin repository and leave the WPGraphQL team some feedback or a review: https://wordpress.org/plugins/wpgraphql-smart-cache/


Jason's Twitter
https://twitter.com/jasonbahl

Jason's GitHub
https://github.com/jasonbahl

WPGraphQL
https://github.com/wp-graphql/wp-graphql

WPGraphQL Smart Cache
https://github.com/wp-graphql/wp-graphql-smart-cache

WPGraphQL Smart Cache with Next.js and Apollo by Fran Agulto
https://developers.wpengine.com/blog/wpgraphql-smart-cache-with-next-js-and-apollo

Episode source