fix(🐛): Skip all response caches when response caching is disabled #537
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
There is a hidden layer of caching that doesn't cache request responses, but only caches processed responses. So in the past, requests might hang even though they had been processed. This processed cache is not accessible when the request is made due to the entangled nature of the various service classes and callbacks. A new response cache was created with #419 behind a flag, then once proven successful, the flag was turned on with #469.
However, it appears that this original processed response cache is causing issues when the same URL is expected to return different assets. This should be possible by disabling the response cache, but that flag only affects the new cache.
Approach
Pass the cache flag down to the response service so it can skip returning cached responses.
This entire layer of caching could be removed since it is redundant with the new cache. However, we could also rewrite this class to be a single helper rather than a service, but that can also be said of other service classes so I'll leave that to a future refactor.