I am wondering how caching works with the API for content negotiation. Since to get the resource in XML or JSON, the URI will be the same, for example:
http:
The service returns JSON / XML based on an Accept header. How smart are hiding places?
For example:
- if one client requested this using the Accept type to return the XML.
- the response is cached by the web server in 1 minute.
- the second client requests the same resource using the Accept type to return JSON
Does checking cache / content types in general? Or will this cause the JSON requester to receive XML data since the server has been cached? I hope this is so obvious that it has already been taken care of, otherwise, is it not a very big argument to include .xml / .json in the URI?
I assume that my question is mainly, can I safely use content negotiation when using standard caching methods?
content-type rest caching content-negotiation
Rostified
source share