apollo-server
apollo-server copied to clipboard
Update caching.md
I think it would be very beneficial to explicitly show how to use Memcached, Redis, or a custom implementation to do response caching using the gateway. It was not obvious to me that this would work as I only know basic Javascript.
Hopefully the code sample I suggested added works. I know in my project, I could not use the import statement and instead had to use require...so not sure if that's quite right, but I think even the statement I added would have helped me get to where I needed to go much faster! Based on a few stack overflow questions, I think it could help others.
@jwalton922: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/
Deploy request for apollo-server-docs pending review.
Visit the deploys page to approve it
| Name | Link |
|---|---|
| Latest commit | 4f639efebe8658df7abeb7719e5ed10f93d61ae5 |
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 4f639efebe8658df7abeb7719e5ed10f93d61ae5:
| Sandbox | Source |
|---|---|
| Apollo Server Typescript | Configuration |
| Apollo Server | Configuration |
Does the link immediately above your new text not help you?
Note that it suggests passing the cache to new ApolloServer rather than to the response cache plugin; that will allow the same cache to be used by other cache-based features like automatic persisted queries and REST data sources (and other plugins that want a cache).
We've significantly rewritten the caching docs including a full page on cache backends. If this doesn't address your concerns let me know!