Last active
October 23, 2016 15:20
-
-
Save pmhsfelix/91fa534d1923a1cb39e769e81c76bdfb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Push model # | |
* Node A is the authoritative source on some resource R | |
* Node B is interested on R's state | |
* Instead of B doing a GET on A (pull) we use a push model where A does a PUT on B | |
* HTTP roles are reversed - the HTTP client doing the PUT (node A) is authoritative for the resource R | |
* A decides the most appropriate times to do this push | |
* A is also the authoritative source on R's ETag | |
* A includes this ETag as a *request* header on the PUT (which is odd, since ETag is defined as a response header on the HTTP spec) | |
* B doesn't know how to compute the ETag. For instance, a GET/HEAD to B will return the ETag PUTed by A | |
* A can make conditional PUTs on B using `if-none-match: current-A-ETag` | |
* This allows A to be stateless regarding the synch state to B, i.e., A doesn't need to "remember" if it already PUTed the last state to B or not. | |
* How does A know the URI where to PUT? | |
* Option: "out-of-band" knowledge, which isn't hypermedia driven | |
* Option: there is an explicit subscription done by B to A that contains B's URI (possibly an URI template if there are multiple resources) | |
* Used in "server-to-server/machine-to-machine" scenarios. | |
# Comments/critiques welcomed # | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
two brief comments: