Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Invalidate on response #245

Open
taily-khucnaykhongquantrong opened this issue Apr 13, 2021 · 1 comment
Open

Invalidate on response #245

taily-khucnaykhongquantrong opened this issue Apr 13, 2021 · 1 comment

Comments

@taily-khucnaykhongquantrong

My server API doesn't return 400 - 500 response code to throw error. They use a specific response with structure such as { err: number; msg: string } with 200 response code. I could use axios interceptor to throw error, but that would not be cached. That's why invalidate on response is really important to me.
PS: I'm not using GraphQL.

@BombaCrazy
Copy link

BombaCrazy commented Jan 4, 2022

I had the same problem. found a better library where you can use a predicate to check if the request should be cached.
https://github.com/arthurfiorette/axios-cache-interceptor#requestcachecachepredicate

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants