Synopsis:
Let's brainstorm more accurate/meaningful Subscribe header values. Here's my suggestion:
Subscribe: this-connection
or Subscribe: retain-on-disconnect=forever
or Subscribe: retain-on-disconnect=<seconds>
Longer Version:
Currently, the Subscribe header does two things:
1. differentiates an HTTP GET request (i.e. a regular non-Braid request) from a Braid subscription request, and
2. describes one of three possible expectations for a Braid subscription after a potential disconnect:
a. "Subscribe"
- as a header on the request, it means "while the connection is open, keep sending me updates to this resource; if the connection closes, the server is not obligated to keep history for me (this client) for any length of time"
- NOTE: this may not be HTTP header compatible, since it does not have a colon and a value
b. "Subscribe: keep-alive"
- as a header on the request, it means: "while the connection is open, keep sending me updates to this resource; even if the connection closes, you (the server) should promise to keep history for me (the client) so that when I reconnect I will still have access to the history as it was when I had been connected"
c. "Subscribe: keep-alive=N [time in seconds]"
- this is like "Subscribe: keep-alive" above, but the client is requesting that the server keep a history for N seconds after any disconnect.
My understanding is that in any of the three expectations above, the server can respond by repeating the Subscribe header (i.e. accepting and making the promise) or by modifying the Subscribe header (i.e. by reducing or eliminating the promise it makes to the client for history retention after disconnect).
I think the meaning of `keep-alive` as currently specified in the Subscription header is slightly misleading:
1. The well-established `Connection:` HTTP 1.1 header (which is also often paired with a "keep-alive" value) "controls whether or not the network connection stays open after the current transaction finishes." So `Connection: keep-alive` means the connection shouldn't be closed, and the "Keep-Alive" header should be heeded. The Subscribe header's "keep-alive" value does not refer to another header (i.e. "Keep-Alive:").
2. The meaning "keep-alive" in "Subscribe: keep-alive" doesn't quite square with "Connection: keep-alive". Braid's "keep-alive" refers to what the server should do with its history after a disconnect, so it isn't really keeping anything "alive" so much as retaining information.
Given the above, I'd like to propose the following:
Subscribe: this-connection
or Subscribe: retain-on-disconnect=forever
or Subscribe: retain-on-disconnect=<seconds>
Other more accurate and/or short-but-descriptive suggestions are welcome.
Best,
Duane