How to invalidate 'other' URIs in case of a PUT request?
A resource can be identified by multiple URIs. e.g.
/person/1234
/person/list?fname=John
/person/list?lname=Doe
all of the above might contain a resource: Person -
id: 1234
fname: John
lname: Doe
age: 10
Say you want to change John Doe's age from 10 to 15. So you PUT the开发者_如何学Python following to /person/1234
id: 1234
fname: John
lname: Doe
age: 15
How do I force the client to invalidate the other 2 urls?
Change the ETag returned by the other two URLs to a new value (eg, a hash of the data).
Make /person/list?fname=John
and /person/list?lname=Doe
redirect to /person/1234
instead of returning the entity data themselves.
精彩评论