Replies: 6 comments 1 reply
-
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.
-
Not stale :/ |
Beta Was this translation helpful? Give feedback.
-
@vektah is it possible to mark this issue as never-stale? |
Beta Was this translation helpful? Give feedback.
-
It would be really good if gqlgen handler.GraphQL could look at cacheControl requestContext key and include on header max-age request it values. Something like https://github.com/apollographql/apollo-server/tree/master/packages/apollo-cache-control Based on that, we could define on our root resolver to include cache control of this query only and obtain frontend caching(nginx) without problem, which always look to header max-age setup. |
Beta Was this translation helpful? Give feedback.
-
another example AWS AppSync https://aws.amazon.com/jp/blogs/mobile/appsync-caching-transactions/ |
Beta Was this translation helpful? Give feedback.
-
how about reviewing the PR? |
Beta Was this translation helpful? Give feedback.
-
Apollo server provides a
@cacheControl
directive and ainfo.cacheControl.setCacheHint
method to respectively define and dynamically set caching rules. They can be respected by a CDN (public), a client (private) or both, and it allows fine-grained cache control down to a single field.While this is probably not a super easy thing to add, I wanted to suggest it in general. It would be very nice for apps with high load (even only on specific paths/fields).
Beta Was this translation helpful? Give feedback.
All reactions