Lets say that for some reason you have multiple requests at the same time asking for the same thing, then the cache is not ready yet and these requests still get sent anyway?
One of the reasons I used local storage here was simplicity. If I used IndexedDB I'd have better results for multiple requests because they'd all be async.
Also, I'm not saying this is perfect. This is just a start and we have a long way to go to implement perfect caching.
Lets say that for some reason you have multiple requests at the same time asking for the same thing, then the cache is not ready yet and these requests still get sent anyway?
One of the reasons I used local storage here was simplicity. If I used IndexedDB I'd have better results for multiple requests because they'd all be async.
Also, I'm not saying this is perfect. This is just a start and we have a long way to go to implement perfect caching.
I got around this by issuing another promise. Something hacky like this: