Cache Improvements


This document describes improvements of Http-Cache in the latest WinRoute 2.1 version. The document will be soon updated with more information.

The main difference in the new version is a new method of storing data into the disc cache. Unlike the other proxy servers with caching functionality (including Microsoft Proxy and Netscape Proxy server) the new version stores passing data into one fixed length file instead of using a single file for each object. The cache file is organized in a FAT-like fashion with allocation unit of 1024 bytes. This significantly saves the disc space occupied by the cache. For better understanding, see the following table showing typical distribution of objects in the cache:

Cache size : 150 MB
1.th column: size in kB 
2.nd column: number of objects
3.rd column: % of total objects

   1   5738  17.57
   2   5626  17.23
   3   4804  14.71
   4   3254   9.96
   5   2615   8.01
   6   1975   6.05
   7   1303   3.99
   8    962   2.95
   9    877   2.69
  10    660   2.02
  11    596   1.83
  12    485   1.49
  13    417   1.28
  14    298   0.91
You may see from the table that 50% of all objects in the cache are smaller than 6 kB. The reason for this is that WWW usually consists of many small objects (html pages, inline images, ...). Storing each object into a single file significantly waste the disc space on nearly every filesystem.

The following calculation assumes the worst case: large disc formatted with 16-bit FAT table. In this case, the size of allocation unit (cluster) is 32kB.

The actual size allocated on disc by old cache is :
32 * (5738 + 5626 + 4804 + 3254 + 2615 + 1975 + 1303) = 32 * 25315 = 810080 kB = 791 MB

The actual size allocated on disc by new cache is :
5738 + 2*5626 + 3*4804 + 4*3254 + 5*2615 + 6*1975 + 7*1303 = 78464 kB = 76 MB

The new cache allocates 10.4 times smaller disc space.

 


Copyright © 1997, 1998 MT-Net, spol. s r. o.