apollographql / apollographql/apollo-server
Support more options in cache-control extension
- Dominant language
- TypeScript
- Stars
- 14k
- Forks
- 2k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 2
Description
Totally agree that it would be great to add some more features. Curious which you are interested in and how you might see them play out in the extensions?
@jakubriedl wrote in apollographql/apollo-cache-control-js/#18
> At this moment caching supports just `maxAge` and `scope` hints. it is a good start but there are much more features which should be supported. In general, it would be great if all applicable HTTP caching features would be supported.
>
> To mention few which we need at this moment
>
> - [Age](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Age) if the responded resource is not absolutely new we can respond the current age. So the cache time can be calculated as `maxAge - Age` and so we can prevent doubling the cache time.
> - [Vary](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Vary) we are using standard content negotiation for determining client language. This header allows to tell the engine what headers should be included in cache key to determine the correct response.
>
> Also, it might be useful to integrate match and time-based validation (`ETag`, `If-None-Match`, `If-Modified-Since`) with the query using directives to reduce the amount of transferred data.
>
> As a final note, I will mention that we are willing and able to help with design, development, and testing but you already know that 😃
Contributor guide
Research direction
Start by reviewing the cache-control extension and the referenced apollographql/apollo-cache-control-js/#18 discussion. Define which HTTP caching options, including Age, Vary, ETag, If-None-Match, and If-Modified-Since, should be supported and how query directives would expose them; done requires an agreed design and corresponding implementation and tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, typescript
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100