<< Back | Gustavo Martin's Home Page |
Using Accept header (you could also use custom headers but Accept header seems better because it already exists in the HTTP protocol. The Accept header is used for choosing the Content-Type.
When forwarding an HTTP request with altered HTTP header fields, in addition to complying with the rules of normal HTTP operation, proxies must include in the request additional fields of the form "X-Device-". In our case Accept header becomes X-Device-Accept.
It must be used the Vary header in order to avoid proxy caches (header changed and proxy does not realize if we do not use the Vary header) When having same URL but different Accept header request, proxies will not return the previously cached URL. What means, proxy will keep track of URL and Accept header to find out whether it is a new request that was not previously cached. The Vary header must be used for request and response (I think)
Example Github: Accept: application/vnd.github.v3+json
Data versioning.
Get Lucky!!!
<< Back | Gustavo Martin's Home Page |