Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Spike GraphQL caching Prototype

Prabhu Ram edited this page Mar 27, 2019 · 1 revision

Analysis on magento/graphql-ce#532

Environment setup

  • Checkout GraphQL-Cache-Prototype
  • Install dev box with varnish capable environment

The prototype has support enabled for functioning GraphQl queries through GET requests, which is a necessary prerequisite for caching through varnish.

What it does

The prototype offers 2 plugins. Both comes as a part of GraphQlCache module which needs to be enabled.

Query Resolver: Adds cache tags to the resolved queries, which is supposed to be based on the entities being resolved. All the tags are mapped to the varnish hash key and invalidating any of those tags invalidates the cache.

Controller Plugin: Adds the cache tags to the response for varnish to consume. Setting setHeader('X-Magento-Debug', 1) will provide additional debug info.

Summary

Supports caching of graphql queries Only through varnish. It is not supported via built in cache.

Clone this wiki locally