WPGraphQL Smart Cache


Do you want your API data fast or accurate? With WPGraphQL Smart Cache, you can have both.

WPGraphQL Smart Cache is a free, open-source WordPress plugin that provides support for caching and cache invalidation of WPGraphQL Queries.

To get the most out of this plugin, we recommend using GET requests with Network Caching, which requires your WordPress install to be on a supported host.

BREAKING CHANGES: We may make breaking changes in the future to improve functionality and experience. If we do, we will use semver to do so. Pay attention to release notes and upgrade notices before updating.

Video Overview



It is recommended that anytime you want to update WPGraphQL Smart Cache that you get familiar with what’s changed in the release.

WPGraphQL Smart Cache publishes release notes on GitHub.

WPGraphQL Smart Cache will follow Semver versioning.

The summary of Semver versioning is as follows:

  • MAJOR version when you make incompatible API changes,
  • MINOR version when you add functionality in a backwards compatible manner, and
  • PATCH version when you make backwards compatible bug fixes.

You can read more about the details of Semver at semver.org

Privacy Policy

WPGraphQL Smart Cache uses Appsero SDK to collect some telemetry data upon user’s confirmation. This helps us to troubleshoot problems faster & make product improvements.

Appsero SDK does not gather any data by default. The SDK only starts gathering basic telemetry data when a user allows it via the admin notice. We collect the data to ensure a great user experience for all our users.

Integrating Appsero SDK DOES NOT IMMEDIATELY start gathering data, without confirmation from users in any case.

Learn more about how Appsero collects and uses this data.


Setyembre 7, 2023
Transitioning to a Gatsby headless CMS showed me huge performance improvements, but at the cost of having to rebuild on every change.With this plugin, a Faust.js + Next.js website can be even faster and more convenient. The website is static and only what you change is being rebuilt on the fly, and cached, without you having to do anything.
Disyembre 6, 2022 1 reply
Jason Bahl and WP Engine knocked it out of the part with this plugin. It makes headless WordPress truly scalable and provides a simple on-demand cache invalidation solution for Node.js hosting platforms and frontend frameworks that don’t have it built in.
Read all 3 reviews

Contributors & Developers

“WPGraphQL Smart Cache” is open source software. The following people have contributed to this plugin.




Chores / Bugfixes

  • #278: ci: Update tests to run against WordPress 6.5


Chores / Bugfixes

  • #273: fix: improve clarity on Cache settings page
  • #272: fix: invalidate caches for menu items


New Features

  • #270: feat: force enable query analyzer. This fixes a regression to WPGraphQL v1.20.0 where the Query Analyzer became optional and defaulted to “off”. WPGraphQL Smart Cache force-enables the Query Analyzer to support Cache tagging and tag-based cache invalidation.


Chores / Bugfixes

  • #266: ci: update tests to run against WordPres 6.4
  • #266: fix: ensure store_content() is passed a string to adhere to phpstan standards
  • #262: fix: remove invalid namespaces from autoloading. Thanks @szepeviktor!
  • #251: ci: add WP 6.3 to test matrix
  • #258: ci: add build-plugin command to set up no-dev


New Features

  • #227: feat: add garbage collection for graphql_documents (see upgrade notice)

Chores / Bugfixes

  • #244: fix: handle errors when editing graphql documents in the admin
  • #253: ci: add varnish docker image. Update docs.
  • #247: fix: remove wpengine specific code (see upgrade notice).
  • #257:257: ci: use .distignore when building plugin for github release


Chores / Bugfixes

  • #237 fix: when creating a new query, do not show “something is wrong with form data” error
  • #242 ci: increase phpstan to level 7
  • #241 ci: increase phpstan to level 5,6
  • #240 ci: increase phpstan to level 3,4
  • #239 ci: increase phpstan to level 2
  • #236 ci: add phpstan workflow to check code quality
  • #234 fix: do not cache mutations to object cache results
  • #235 ci: tests failing after wpgraphql v1.14.5 release


Chores / Bugfixes

  • #230 fix: disable cache maps when “Use Object Cache” is disabled


Chores / Bugfixes

  • #226 fix: add missing events to purge calls. Remove call to purge list of terms when term relationship has changed.


Chores / Bugfixes

  • #221 fix: updating menus not assigned to locations doesn’t purge menus, even if their model is public


New Features

  • #215 feat: graphql_purge_logs

Chores / Bugfixes

  • #214 fix: over-purging tags


  • #210 fix: post_exists being called even though the post_exists function doesn’t exist in this context. Check instanceof WP_Post instead.


  • #207 fix: ignore updates to “apple_news_update” meta key. Add graphql_cache_ignored_meta_keys filter for modifying the list of ignored meta keys.
  • #205 fix: ErrorException Warning: Attempt to read property “post_type” on null. Thanks @izzygld!


Chores / Bugfixes

  • #202 fix: ErrorException Warning: Attempt to read property “post_type” on null. Thanks @izzygld!


Chores / Bugfixes

  • Add workflow to update plugin assets/readme when those files are changed
  • update links to docs. Thanks @rodrigo-arias!
  • set internal taxonomies to public => false, add tests.
  • fix bug with the “purge cache” button in the settings page not properly purging all caches for WPEngine users


  • Version change. no functional changes.


  • fix: vendor directory not properly deploying to WordPress.org.


  • fix: rename constant that didn’t get updated in 0.3.4. Thanks @colis!


  • chore: update readme.txt file which is displayed on WordPress.org


  • fix: correct slug in deploy workflow


  • (#189): chore: add workflow to deploy to the WordPress.org repo


  • (#188): fix: update constant name for min required version of WPGraphQL. Conflict with constant name defined in WPGraphQL for ACF.


  • (#184): fix: update min required version of WPGraphQL. This plugin relies on features introduced in v1.12.0 of WPGraphQL.


New Features

  • (#178): feat: add new “graphql_cache_is_object_cache_enabled” filter


  • (#179): fix: prevent error when users install the plugin with Composer


  • chore: update readme.txt with tags, updated “tested up to” version
  • chore: update testing matrix to run tests on more versions of WordPress and PHP
  • chore: update docs
  • chore: add icons and banner for WordPress.org


  • feat: a LOT of updates to the documentation
  • feat: add opt-in telemetry via Appsero.


  • fix: fixes a bug where X-GraphQL-Keys weren’t being returned properly when querying a persisted query by queryId


  • fix bug with patch. Missing namespace


  • add temporary patch for wp-engine users. Will be removed when the wp engine mu plugin is updated.

= 0.2.0

  • chore: remove unreferenced .zip build artifact
  • feat: remove a lot of logic from Collection.php that analyzes queries to generate cache keys and response headers, as this has been moved to core WPGraphQL
  • feat: reference core WPGraphQL functions for storing cache maps for object caching
  • chore: remove unused “use” statements in Invalidation.php
  • feat: introduce new “graphql_purge” action, which can be hooked into by caching clients to purge caches by key
  • chore: remove $collection->node_key() method and references to it.
  • feat: add “purge(“skipped:$type_name)” event when purge_nodes is called
  • chore: remove model class prefixes from purge_nodes() calls
  • chore: update tests to remove “node:” prefix from expected keys
  • chore: update tests to use self::factory() instead of $this->tester->factory()
  • chore: update Plugin docblock
  • feat: add logic to ensure minimum version of WPGraphQL is active before executing functionality needed by it
  • chore: remove filters that add model definitions to Types as that’s been moved to WPGraphQL core


  • Updates to support batch queries
  • move save urls out of this plugin into the wpengine cache plugin
  • updates to tests


  • Initial release to beta users