This repository was archived by the owner on Dec 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 152
This repository was archived by the owner on Dec 19, 2019. It is now read-only.
[Prototype] Server-side query caching #17
Copy link
Copy link
Closed
Labels
frameworkmagento-coreEpics and issues assigned to Magento core team members.Epics and issues assigned to Magento core team members.medium
Description
Varnish:
- Start accepting GraphQL queries as GET requests
- see proposal from @paales in comments
- example,
http://magento.api/graphql?query={queryName{fieldName}}
. The whole query goes to the URL - enables caching with Varnish without new dependencies
- caching will not work with GraphQL queries sent as POST requests
- requires slight modification of existing Magento GraphQL framework to start accepting GET requests
- recommended by https://graphql.org/learn/serving-over-http
Use cases that should be supported
- Products query contains a list of category assignments. In this case when the category is changed the product cache must be invalidated. If products query didn't contain category assignment, then changes in the category must not affect the product cache.
- Queries, which contain search criteria may get outdated when the new products are added or any product in the system is modified. Cache should be invalidated in this case.
Prototype
https://github.com/magento/graphql-ce/tree/GraphQL-Cache-Prototype
Has the following concepts tested:
- GraphQL queries via HTTP GET
- Generation of Varnish tags in a modular way without direct modifications of the resolvers
- Caching of product queries and invalidation on related product updates
Considered alternatives
- Implement Varnish support for POST requests
- will require Varnish to be able to parse POST requests
- non-standard implementation, needs custom Varnish module installation (something like https://github.com/aondio/libvmod-bodyaccess )
Metadata
Metadata
Assignees
Labels
frameworkmagento-coreEpics and issues assigned to Magento core team members.Epics and issues assigned to Magento core team members.medium