apollographql / apollographql/datasource-rest

301 redirects (with default `redirect: 'follow'`) are not cached in v5

Open
#102 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
48
Forks
21
PR merge metrics
No merged PRs in 30d

Description

Before v5 (not quite released as I file this issue) all GETs got cached forever. In v5 we are fixing that (#100) which fixes the reported issue (#39) that 302s (temporary redirects) were being cached.

However, this introduces the new issue that 301s (permanent redirects) are now *not* being cached. That's because (assuming use have the default `redirect: 'follow'` in your fetch request) RESTDataSource only sees the response from the final request, not any intermediate request.

Fixing this would require us to implement redirect support ourselves which is probably not a great idea, so this may be more of a "documentation of an issue" than something that's likely to be fixed.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the v5 caching change in issue #100 and the original 302 redirect report in issue #39, then inspect RESTDataSource's handling of the default `redirect: 'follow'` behavior. Determine whether the intended outcome is documentation of the 301 caching limitation or a design for redirect handling; completion is not defined in this issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend, performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.