axios-cache-interceptor icon indicating copy to clipboard operation
axios-cache-interceptor copied to clipboard

Update documentation to clear out unknown behaviors

Open arthurfiorette opened this issue 2 years ago • 2 comments

  • [ ] Add what each debug message implies. Its still hard to understand the debug output and what to do with it. Would help issues like #578
  • [x] Change cacheTakeover docs to explain on why Pragma is needed for iOS Safari work, https://bugs.webkit.org/show_bug.cgi?id=170714. Use #579 and #471 as reference.

arthurfiorette avatar Jul 01 '23 14:07 arthurfiorette

@arthurfiorette Maybe some sort of flow diagram would also be helpful, also when people are submitting a pull requests so they know what other cases to think about.

After implementation we see a lot of requests taking 15 seconds, I think it has something to do with the waiting logic in combination with errors. Some endpoints throw 404's because there is no data at the time, but I have a feeling concurrent requests might be waiting and then retrying the response, is this true? (and are they possibly then waiting for the next, and then retrying again, and then all waiting for the next, and then retrying a.k.a. dogpile effect?)

Trying to understand when this happens:

// src/interceptors/request.ts

// The deferred is rejected when the request that we are waiting rejects its cache.
// In this case, we need to redo the request all over again.
return onFulfilled(config);

I'm trying to figure out why it happens, but it's kind a of hard to understand at the moment by just reading through the code.

edwinveldhuizen avatar Apr 28 '24 11:04 edwinveldhuizen

Hey @edwinveldhuizen, I'm busy for these next few months and cannot work in this project for free :/

You can try to run a single test at a time with your debugger enable to see where it goes, the code path is fairly simple, just tricky because there are a thousand of options in this library.

arthurfiorette avatar May 07 '24 12:05 arthurfiorette