The spec for the BINARY protocol get-request reads as follows:
4.2. Get, Get Quietly, Get Key, Get Key Quietly
Request:
MUST NOT have extras. <<<< SAYS THIS, BUT...
MUST have key.
MUST NOT have value.
o 4 byte flags <<<<< SEE HERE
Response (if found):
MUST have extras.
MAY have key.
MAY have value.
o 4 byte flags <<< AND SEE HERE ?!?!
Extra data for the get commands:
Byte/ 0 | 1 | 2 | 3
|
/ | | |
|
|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6
7|
+---------------+---------------+---------------+---------------
+
0| Flags
|
+---------------+---------------+---------------+---------------
+
My take on the above is that the flags field is actually part of the
request AND part of the response. But the verbiage is contradicts
itself.
The TEXT protocol spec says,
"<flags> is an arbitrary 16-bit unsigned integer (written out in
decimal) that the server stores along with the data and sends back
when the item is retrieved. Clients may use this as a bit field to
store data-specific information; this field is opaque to the server.
Note that in memcached 1.2.1 and higher, flags may be 32-bits, instead
of 16, but you might want to restrict yourself to 16 bits for
compatibility with older versions."
The verbiage of the TEXT protocol seems to imply however that for the
GET request there should be no FLAGS field, and that it will exist for
the response however, though it does not directly make this claim.
So which is it, does the GET request have a FLAGS field, or not?