The server MUST accept all valid HTTP GET requests to the subscriber location. All other request methods SHOULD be responded to with a 405 Method Not Allowedstatus code. Subscriber requests are considered notifications of intent to receive some message. Subscribers may request existing messages, messages that are not yet available, and messages that are no longer available. The requested message is>If-Modified-Since and If-None-Match request headers. A request with no If-Modified-Since header MUST be assumed to be requesting the oldest available message in a channel. Each 200 OK response containing a message MUST have itsLast-Modified and Etag headers set so that a request using those headers will be interpreted as a request for the next available message. Additionally, said 200 OKMUST contain the Content-Type header of the message publisher request, unless no Content-Type header had been provided or it is explicitly overridden by server configuration.
There are several common mechanisms for performing an HTTP server push. The rest of the behavior of the server in response to a subscriber request SHOULD be configurable and MUST be selected from the following list of mechanisms:
Long-Polling Requests for existing messages will be responded to immediately; responses to requests for messages not yet available MUST be delayed until the message becomes available. Delayed responses MUST satisfy all of the following conditions:
A 200 OK response containing the message (and its Content-Type) MUST be sent immediately after the message becomes available . The entire response must be indistinguishable from a response to a request for an existing message.
If the channel the subscriber is waiting on is deleted or for some reason becomes unavailable, the server MUST immediately send a 410 Gone response.
If another subscriber has conflicted with this request, the server MUST immediately send a 409 Conflict response.
Interval-Polling All requests will be responded to immediately. Requests for messages not yet available MUST produce a 304 Not Modified response code. In addition, when the server receives more than one concurrent subscriber request on the same channel, it MUST do one of the following:
Broadcast No additional actions are performed Last-in, first-out All but the most recent long-held subscriber request on the channel are sent a 409 Conflict response. First-in, last-out All but the oldest request will be sent a 409 Conflict The server SHOULD make this selection configurable, and MUST default to broadcast behavior.