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
Currently when you request the same URL two times immediately, both hit the network and will resolve with their respective response afterwards.
This happens because the cache manager is only consulted at these two stages:
Before a request is fired off, the cache manager is asked if there is already a response.
After a request is finished, the response will be put inside the cache.
I think it would be helpful if there would be a lookup if a request is already in flight, and if so, return the promise of that request instead of making the same request again.
Note that this should only be the case for idempotent calls – mostly GET. PUT could also work, but the request body needs to be part of the cache identifier then.
The text was updated successfully, but these errors were encountered:
What / Why
Currently when you request the same URL two times immediately, both hit the network and will resolve with their respective response afterwards.
This happens because the cache manager is only consulted at these two stages:
I think it would be helpful if there would be a lookup if a request is already in flight, and if so, return the promise of that request instead of making the same request again.
Note that this should only be the case for idempotent calls – mostly GET. PUT could also work, but the request body needs to be part of the cache identifier then.
The text was updated successfully, but these errors were encountered: