You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You have API-A that as part of its request requires an auth token from API-B, Once you get a response for API-A you cache the payload for 24 hours in something like redis.
A new request comes in that requires API-A, However you don't want to request API-B again if its in the cache. It would be good if there was a restdatasource hook that would only be called if its not in the cache to allow you to fetch auth tokens before sending the request again.
the flow would be something like
because the request API-A has a dependency on API-B you have to fetch it before making the request to API-A even if API-A is in the cache because the cache check is only done on fetch meaning you have to build the full request prior to sending.
you could in theory manually checking redis via the context is possible but I am sure there are a few usecases for a cache-miss hook that could be abstracted to a function
The text was updated successfully, but these errors were encountered:
Issue
You have API-A that as part of its request requires an auth token from API-B, Once you get a response for API-A you cache the payload for 24 hours in something like redis.
A new request comes in that requires API-A, However you don't want to request API-B again if its in the cache. It would be good if there was a restdatasource hook that would only be called if its not in the cache to allow you to fetch auth tokens before sending the request again.
the flow would be something like
because the request API-A has a dependency on API-B you have to fetch it before making the request to API-A even if API-A is in the cache because the cache check is only done on fetch meaning you have to build the full request prior to sending.
you could in theory manually checking redis via the context is possible but I am sure there are a few usecases for a cache-miss hook that could be abstracted to a function
The text was updated successfully, but these errors were encountered: