2

Is the response from an Angular $http request cached before or after any transformResponse functions have been applied?

Use case: My client's REST API returns a lot of metadata (most of which I don't need) so I don't want to cache the entire response. I'd like to apply a specific transformResponse for each different API end-point that copies only the fields I need into a new object\array and dispose of the original. I would then like the new object to automatically be cached. This should be nice and easy if the return data from transformResponse is cached.

1

1 Answer 1

3

Apparently is cached before transforming, as you can see in $http#717 sendReq is called before transformResponse, and in $http#958 you can see sendReq does the caching

Maybe you can be sure by doing a test

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.