-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apollo RESTDataSource is caching the error response #6438
Comments
This is not well enough documented, but this is working as intended. RESTDataSource has two levels of caching: one which caches the response to a particular HTTP method within a single operation's execution, and one that writes to the shared cache. The second cache pays attention to HTTP error response codes; the first does not, assuming that an operation that returns an error will continue to return the same error if invoked during the same operation. See #1562 (comment) for some discussions of this. (One could imagine that this is not the ideal behavior, though. RESTDataSource has not been actively maintained for a while but we hope to fix that this year.) |
I am using apollo in memory LRU caching along with RESTDataSource. This works fine in case of 200 response where the DS caches the response. But in case of any API error, the RESTDataSource is still caching the response. How can I disable the cache or set the TTL to 0 in case of an error?
The text was updated successfully, but these errors were encountered: