O'Reilly logo

Web Caching by Duane Wessels

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

HTCP Opcodes

HTCP/0.0 defines five opcodes: NOP, TST, MON, SET, and CLR. Note that ICP has different opcodes for queries and replies—for example, ICP_OP_QUERY and ICP_OP_MISS. HTCP, however, uses the same opcode for both messages. The previously described RR flag indicates whether a given message is a request or a response. The following sections describe each opcode, including how each one uses the OP-DATA field.

NOP

The NOP (null operation) opcode is similar to an ICMP echo or a ping message. It can be used to measure network delays between caches, as well as simply to find out if they are alive.

There is no OP-DATA for either NOP queries or responses, and the RESPONSE code is always zero.

TST

The TST (test) opcode is similar to the ICP query operation. It tests for the existence of a cached response in a neighbor cache.

TST request

For a TST request, the OP-DATA is a SPECIFIER. Recall that a SPECIFIER includes the HTTP request method, URI, HTTP version, and the client’s request headers. The request headers are important because the client may have certain freshness requirements (Cache-control: max-age or max-stale).

TST response

Table D-2 shows the RESPONSE codes defined for a TST response when F1 is not set.

Table D-2. HTCP TST Response Codes

CodeDescription
0Entity is present in responder’s cache.
1Entity is not present in responder’s cache.

Note that the RESPONSE code indicates only the presence or absence of the object and says nothing about its freshness. If the cached object ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required