datasource-rest icon indicating copy to clipboard operation
datasource-rest copied to clipboard

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

Open glasser opened this issue 1 year ago • 1 comments

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.

glasser avatar Nov 28 '22 19:11 glasser