HTCP Data Types

HTCP messages are built on a simple hierarchy of data types. I’ll start with the most simple and finish with the complex ones.

COUNTSTR

A COUNTSTR is a string of ISO8859-1 (Latin-1) characters preceded by the length of the string. The string length is encoded (in network byte order) using two octets. The string is not necessarily null-terminated. For example, the following hexadecimal values encode the string Cache as a COUNTSTR:

00 05 43 61 63 68 65
    5  C  a  c  h  e

SPECIFIER

HTCP SPECIFIER format

Figure D-5. HTCP SPECIFIER format

A SPECIFIER, shown in Figure D-5, encodes an HTTP request using four COUNTSTRs. It is used in TST, SET, and CLR requests, and in MON responses. METHOD, URL, and VERSION are all taken from the first line of an HTTP request. REQ-HDRS consists of all the remaining request headers.

DETAIL

Figure D-6 shows the DETAIL type, which is used in TST response messages. It provides the information about a cached response. These are all HTTP-style headers with CRLF line termination. RESP-HDRS is the set of HTTP response headers, as defined in Section 6.2 of RFC 2616. These include Etag, Age, and others. ENTITY-HDRS is the set of HTTP headers defined in Section 7.1 of RFC 2616. These include Expires, Last-modified, and others. CACHE-HDRS, on the other hand, are defined by HTCP, rather than HTTP. They are used to convey additional information about a resource that may prove to be useful. ...

Get Web Caching now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.