Varnish with GraphQl #5132
Replies: 5 comments
-
Or simply http cache doesn't work for GraphQl yet? |
Beta Was this translation helpful? Give feedback.
-
It's not done because it may be dangerous. You can take a look at the conference I did about that: https://speakerdeck.com/dunglas/rest-vs-graphql-illustrated-examples-with-the-api-platform-framework |
Beta Was this translation helpful? Give feedback.
-
See also: #2134 |
Beta Was this translation helpful? Give feedback.
-
@dunglas , I understand that to cache GraphQl's responses we have to consider all the related entities (at least classes) in each particular request, to be able to cache and invalidate them. |
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Beta Was this translation helpful? Give feedback.
-
Good morning.
I found that in a case of GraphQl request Api-Platform doesn't add http headers (even if it's a GET request):
core/src/HttpCache/EventListener/AddHeadersListener.php
Lines 43 to 48 in 4dacd1a
It's because the second check
RequestAttributesExtractor::extractAttributes($request)
returns empty array. Am I doing something wrong or it's a bug?Beta Was this translation helpful? Give feedback.
All reactions