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

[Prototype] Server-side query caching #17

@paliarush

Description

@paliarush

Varnish:

  1. 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

  1. 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.
  2. 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

  1. Implement Varnish support for POST requests

Metadata

Metadata

Assignees

Labels

frameworkmagento-coreEpics and issues assigned to Magento core team members.medium

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions