Suppose you get a scenario where you have to design a proxy which gives a JSON response or XML response based on the 'Accept' Header. If the user of the proxy sends, Accept header = application.json, you should gives JSON response, if he sends application/xml, you should guve XML response. If you have added a response cache in such a proxy, you will run into some issues
1.) If the user expects a JSON response, a JSON output would be stored in the cache.
2.) Now when the user expects an XML response, because the response cache is present in both the request and response flow, it will first hit the response cache and you will get a JSON response instead of an XML response.
The solution to this, is to use a small but a valuable property while configuring response cache. <UseAcceptHeader>true</UseAcceptHeader>
In this case, the accept header would be suffixed to your cache key, which will help the cache distinguish between different types of responses.
Thanks @Raunak Narooka Great Info !!