An Example

If you find yourself in the position of implementing Cache Digests, you can use the following two tables to verify your code. Table E-2 shows three sample URIs and their MD5 hash values. Table E-3 lists the same three URIs with the bit positions for four hash functions based on the MD5 column in Table E-2. This example uses a MASK_SIZE of 625,000 bytes, or 5,000,000 bits.

Table E-2. Cache Digest Example: URIs and Hash Values

MethodURIMD5
GET http://www.squid-cache.org 69677C33244C8D776D1ED1210E07C120
GET http://www.oreilly.com 4DC8FAFB9B5B0A4C08D992E453059333
GET ftp://ftp.ircache.net F36FB917F5D687629A6E2BEB6BB569FF

Table E-3. Cache Digest Example: URIs and Bit Positions

MethodURIB1B2B3B4
GET http://www.squid-cache.org 3,389,6833,996,727736,161389,216
GET http://www.oreilly.com 17,0831,434,8923,476,6442,874,291
GET ftp://ftp.ircache.net 4,185,3674,477,282911,4672,051,263

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.