-
Notifications
You must be signed in to change notification settings - Fork 1.7k
GraphQL caching #4402
GraphQL caching #4402
Conversation
This PR replaces #4260 |
* `cart` | ||
* `country` | ||
* `countries` | ||
* `currency` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of curiosity, Why wouldn't it be valid to cache countries, country and currency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because it's not supported yet, the caching invalidation for system conf doesn't work with graphql
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor suggestions/questions.
Co-Authored-By: keharper <keharper@users.noreply.github.com>
* `cart` | ||
* `country` | ||
* `countries` | ||
* `currency` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because it's not supported yet, the caching invalidation for system conf doesn't work with graphql
## Request headers | ||
|
||
Magento accepts the following headers in a GraphQL request: | ||
|
||
Header name | Value | Description | ||
--- | --- | --- | ||
`Authorization` | `Bearer <authorization_token>` | A customer token. [Get customer authorization token]({{ page.baseurl }}/graphql/get-customer-authorization-token.html) describes how to generate the token. | ||
`Content-Currency` | A valid currency code, such as `USD` | This header is required only if the currency is not the store view's default currency. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This information came in late but by doing Store & Content-Currency we're not repecting the caching RFC standard, which uses Vary instead as computed.
https://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html
https://tools.ietf.org/html/rfc7231#section-7.1.4
Content-Currency & Store is obviously not part of a standard,
and also we don't respond with a Vary. The frontend currently does, but it sets it in cookie not in headers
We don't respond with it at all, but we'll address this in a future story.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created internal ticket MC-16230 to track the doc work when the code changes.
Hi @keharper, thank you for your contribution! |
Purpose of this pull request
This PR adds documentation for magento/graphql-ce#230 and internal ticket MC-15959
whatsnew
Added topics about GraphQL caching and identity classes.