graphql-hive / graphql-hive/envelop

[ResponseCache] Should response be cached only if all types have opt-in

Open
#1,885 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
827
Forks
132
PR merge metrics
No merged PRs in 30d

Description

With the current implementation, a response is cached based on if at least one type or field is cachable in the response.

Apollo's response cache plugin is doing things the other way around: the response is cached only if **every** fields and types have a TTL greater than 0 (which is the default TTL for every composite types or fields).

The Apollo's approach makes the caching more predictable, since an entity can't be cached just because some other entity in the response is marked as cachable.

Should we do the same thing ?

## Additional context

Here are more details on their philosophy on this: https://www.apollographql.com/docs/apollo-server/performance/caching#default-maxage

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.