Allow disabling introspection responses going to cache
Is your feature request related to a problem? Please describe. Currently, introspection queries and their response data is saved to the cache, which also populated in Redis.
https://github.com/apollographql/router/blob/615b74d9cec12d2ea94109335b8321fea73d688a/apollo-router/src/introspection.rs#L79
If I have an extremely large schema and I have clients making slightly different introspection queries this can start sending lots of data to my Redis instance and eating up performance, bandwith, and storage
Describe the solution you'd like Allow configuring or disabling if introspection responses are cached or not
Enabled cache
supergraph:
introspection:
enabled: true
cache:
in_memory:
limit: 1
redis:
urls: [ "redis://localhost:6379" ]
Disabled cache
supergraph:
introspection:
enabled: true
cache: false # Not sure what is better here. I think default should be cache on, so how do we turn it off?
cache:
in_memory:
enabled: false
redis:
enabled: false
Describe alternatives you've considered There is no control over this today. I need to enforce that introspection is all the same or I can disable it entirely
supergraph:
introspection: false
Additional context Maybe as part of the issue https://github.com/apollographql/router/issues/4608 we can add more features
OR
We could lock down introspection to only 1 predefined operation: https://github.com/apollographql/router/issues/4871
Introspection is not computationally expensive. I wonder if we’d be better off not caching it at all.
We may have only cached it previously because it was going through the router-bridge.
I'm particularly unsure why we would ever cache it in Redis.
This issue is already causing OOM problems and could affect all users that use introspection. It would be great if this can be addressed as soon as possible, especially if it's a quick fix.