flowchart TB Title[Debug Messages Guide
Understanding axios-cache-interceptor debug output] Title --> ReqSection[REQUEST INTERCEPTOR MESSAGES] Title --> ResSection[RESPONSE INTERCEPTOR MESSAGES] Title --> ErrSection[ERROR INTERCEPTOR MESSAGES] ReqSection --> Msg1["'Ignoring cache because config.cache === false'"] Msg1 --> Exp1[Meaning: Caching is disabled for this request
Action: Request proceeds normally without caching
Reason: config.cache was explicitly set to false] ReqSection --> Msg2["'Ignored because url matches ignoreUrls'"] Msg2 --> Exp2[Meaning: URL is blacklisted from caching
Action: Request proceeds without caching
Reason: URL matches a pattern in cachePredicate.ignoreUrls] ReqSection --> Msg3["'Cached because url matches allowUrls'"] Msg3 --> Exp3[Meaning: URL is whitelisted for caching
Action: Continue with cache logic
Reason: URL matches a pattern in cachePredicate.allowUrls] ReqSection --> Msg4["'Ignored because url does not match any allowUrls'"] Msg4 --> Exp4[Meaning: URL not in whitelist when whitelist is defined
Action: Request proceeds without caching
Reason: allowUrls is configured but URL doesn't match any pattern] ReqSection --> Msg5["'Ignored because method not in cache.methods'"] Msg5 --> Exp5[Meaning: HTTP method not cacheable
Action: Request proceeds without caching
Reason: Method like POST, PUT, DELETE not in cache.methods array
Note: Default methods are GET and HEAD only] ReqSection --> Msg6["'Waiting list had a deferred for this key, waiting for it to finish'"] Msg6 --> Exp6[Meaning: Another request for same resource is in progress
Action: Wait for that request to complete
Reason: Prevents duplicate requests for same resource
Result: Will use result from the first request] ReqSection --> Msg7["'Updated stale request'"] Msg7 --> Exp7[Meaning: Added conditional headers to request
Action: Request sent with If-None-Match or If-Modified-Since
Reason: Have stale data, asking server if it changed
Result: May receive 304 Not Modified if unchanged] ReqSection --> Msg8["'Sending request, waiting for response'"] Msg8 --> Exp8[Meaning: Making actual HTTP request to server
Action: Request proceeds to adapter
Reason: No fresh cache available or override requested
States: Cache state was empty, stale, or must-revalidate] ReqSection --> Msg9["'Detected concurrent request, waiting for it to finish'"] Msg9 --> Exp9[Meaning: Another request for same key is loading
Action: Wait for other request's deferred promise
Reason: Optimizes to avoid duplicate network requests
Result: Will share the result once available] ReqSection --> Msg10["'Deferred rejected, requesting again'"] Msg10 --> Exp10[Meaning: The concurrent request failed
Action: Make a new request instead of using failed result
Reason: Cannot rely on failed request's result
Note: This is a retry mechanism] ReqSection --> Msg11["'Deferred resolved, but no data was found, requesting again'"] Msg11 --> Exp11[Meaning: Cache mismatch - deferred resolved but no data in storage
Action: Make a new request
Reason: Unexpected state, likely storage was cleared mid-request
Note: This should rarely happen] ReqSection --> Msg12["'Returning cached response'"] Msg12 --> Exp12[Meaning: Returning data from cache without HTTP request
Action: Use cached adapter instead of real adapter
Reason: Have fresh cached data
Result: No network request made, instant response] ResSection --> Msg13["'Returned cached response'"] Msg13 --> Exp13[Meaning: Response came from cache
Action: Return immediately without processing
Reason: response.cached === true
Note: Already processed in request interceptor] ResSection --> Msg14["'Response with config.cache falsy'"] Msg14 --> Exp14[Meaning: Response has no cache config
Action: Return without caching
Reason: Cache was disabled or not configured
Note: Should rarely happen in normal flow] ResSection --> Msg15["'Ignored because method not in cache.methods'"] Msg15 --> Exp15[Meaning: Response from uncacheable method
Action: Return without caching
Reason: Method not configured for caching
Note: Duplicate check from request interceptor] ResSection --> Msg16["'Response not cached and storage isn't loading'"] Msg16 --> Exp16[Meaning: Unexpected state mismatch
Action: Return response without caching
Reason: Storage state should be 'loading' but isn't
Note: May indicate request interceptor was bypassed] ResSection --> Msg17["'Cache predicate rejected this response'"] Msg17 --> Exp17[Meaning: Response doesn't meet caching criteria
Action: Reject cache and remove from storage
Reason: Failed statusCheck, responseMatch, or containsHeaders
Example: Status code not in allowed list 200, 203, 300, etc.] ResSection --> Msg18["'Cache header interpreted as dont cache'"] Msg18 --> Exp18[Meaning: Server headers forbid caching
Action: Reject cache and remove from storage
Reason: Cache-Control: no-cache/no-store or private on server
Headers: Server sent explicit cache prevention directives] ResSection --> Msg19["'Useful response configuration found'"] Msg19 --> Exp19[Meaning: Successfully calculated cache TTL and config
Action: Proceeding to save to storage
Reason: All validations passed
Info: Contains cacheConfig and cacheResponse data] ResSection --> Msg20["'Found waiting deferred(s) and resolved them'"] Msg20 --> Exp20[Meaning: Resolving other waiting requests
Action: Notify concurrent requests that data is ready
Reason: Multiple requests were waiting for this response
Result: All waiting requests now get the cached data] ResSection --> Msg21["'Response cached'"] Msg21 --> Exp21[Meaning: Successfully saved response to cache
Action: Data now available for future requests
Reason: All caching conditions met
State: Storage state is now 'cached'] ErrSection --> Msg22["'FATAL: Received non-axios error in rejected interceptor'"] Msg22 --> Exp22[Meaning: Unknown error type received
Action: Re-throw error, cannot handle
Reason: Error is not from Axios
Impact: May leave storage in loading state] ErrSection --> Msg23["'Web request returned error but cache handling not enabled'"] Msg23 --> Exp23[Meaning: Error occurred but caching is disabled
Action: Re-throw error
Reason: config.cache or config.id missing
Note: Normal error flow without cache] ErrSection --> Msg24["'Caught an error in the request interceptor'"] Msg24 --> Exp24[Meaning: Error but storage state is unexpected
Action: Clean up and re-throw
Reason: State not 'loading' or previous not 'stale'
Note: Cannot use staleIfError logic] ErrSection --> Msg25["'Found cache if stale config for rejected response'"] Msg25 --> Exp25[Meaning: Evaluating staleIfError option
Action: Check if can return stale data instead of error
Reason: config.staleIfError is configured
Next: Evaluate if stale data is still usable] ErrSection --> Msg26["'Found waiting deferred(s) and resolved them'"] Msg26 --> Exp26[Meaning: Resolving waiting requests with stale data
Action: Return stale cached data to all waiting requests
Reason: staleIfError allowed using stale data
Result: Error avoided by using cached data] ErrSection --> Msg27["'staleIfError resolved this response with cached data'"] Msg27 --> Exp27[Meaning: Returning stale data instead of error
Action: Return cached response marked as stale
Reason: Request failed but stale data acceptable
Properties: cached: true, stale: true] ErrSection --> Msg28["'Received unknown error that could not be handled'"] Msg28 --> Exp28[Meaning: Error cannot be recovered with staleIfError
Action: Reject cache and re-throw error
Reason: staleIfError not configured or expired
Result: Error propagates to caller] style Title fill:#e1f0ff,stroke:#333,stroke-width:3px style ReqSection fill:#d4edda,stroke:#333,stroke-width:2px style ResSection fill:#d1ecf1,stroke:#333,stroke-width:2px style ErrSection fill:#f8d7da,stroke:#333,stroke-width:2px style Exp1 fill:#fff4e1 style Exp2 fill:#fff4e1 style Exp3 fill:#d1ffe1 style Exp4 fill:#fff4e1 style Exp5 fill:#fff4e1 style Exp6 fill:#e1f0ff style Exp7 fill:#e1f0ff style Exp8 fill:#e1f0ff style Exp9 fill:#e1f0ff style Exp10 fill:#ffe8d1 style Exp11 fill:#ffe8d1 style Exp12 fill:#d1ffe1 style Exp13 fill:#d1ffe1 style Exp14 fill:#fff4e1 style Exp15 fill:#fff4e1 style Exp16 fill:#ffe8d1 style Exp17 fill:#ffe1e1 style Exp18 fill:#ffe1e1 style Exp19 fill:#d1ffe1 style Exp20 fill:#e1f0ff style Exp21 fill:#d1ffe1 style Exp22 fill:#ffe1e1 style Exp23 fill:#fff4e1 style Exp24 fill:#ffe8d1 style Exp25 fill:#e1f0ff style Exp26 fill:#e1f0ff style Exp27 fill:#d1ffe1 style Exp28 fill:#ffe1e1