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

Commit 9246d1e

Browse files
authored
Update also v.2.3
1 parent b4e4c07 commit 9246d1e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/guides/v2.3/graphql/caching.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,25 @@ To enable GraphQL caching on Fastly:
109109

110110
[Set up Fastly]({{ site.baseurl }}/cloud/cdn/configure-fastly.html) describes how to perform both of these tasks.
111111

112+
By default Faslty module for Magento provides follwing VCL configuration for GraphQL caching:
113+
114+
```text
115+
if (req.request == "GET" && req.url.path ~ "/graphql" && req.url.qs ~ "query=") {
116+
....
117+
```
118+
119+
Fastly will cache only GET requests which contains query parameter in request url.
120+
121+
### Example
122+
123+
```text
124+
http://example.com/graphql?a=1&query={ products(filter: {sku: {eq: "Test"}}) { items { name } } }&variables={}
125+
....
126+
```
127+
128+
{:.bs-callout-info}
129+
Be aware, if you calling GraphQL queries by transferring query body not in the url (e.g. as --data-raw '{"query" .... }'), then request will not be cached.
130+
112131
## X-Magento-Vary
113132

114133
The `X-Magento-Vary` cache cookie is not supported for GraphQL. The `Store` and `Content-Currency` headers, along with the content language (which is deduced) determine the context.

0 commit comments

Comments
 (0)