Recently I have been working on GraphQL APIs. Due to the scalability of the project, I want to know if can i cache the response coming from apis.
I know that we can use the query cache and schema cache facility from the lighthouse package. However, my concern is they cache the response during the use of the cache facility in the project.
if we cannot cache the API’s response using query cache directives then how can I can do that in my project?
New contributor
1
If you want to cache the final response, no there isn't any built-in solution for this. You can use the lighthouse-php.com/master/api-reference/events.html#endrequest to capture the final response and do what you want. Another option will be varnish. Anyway, you have to analyze the incoming POST request to build a unique cache key.
42 mins ago