graphql-proxy-cache
The graphql-proxy-cache
plugin provides the capability to cache responses for GraphQL queries. It uses MD5 algorithm to generate cache key based on the plugin configurations and GraphQL queries. The plugin supports both disk-based and memory-based caching options to cache for GET and POST GraphQL requests.
If a request contains a mutation operation, the plugin will not cache the data. Instead, it adds an Apisix-Cache-Status: BYPASS
header to the response to show that the request bypasses the caching mechanism.
Examples
The examples below use GitHub GraphQL API as an upstream and demonstrate how you can configure graphql-proxy-cache
for different scenarios.
To follow along, create a GitHub personal access token with the appropriate scopes for the resources you want to interact with.