twhttpd Documentation

Copyright 2002 by Sam Ng

Version 1.01


Part D: In-depth Program Details

Part D.1: Cache Control Details

There are basically 3 cache controls in twhttpd.

1) pragam: no-cache

If this happens in client http request header, it usually means the user press the reload button in their browser. We can ignore this option safely, other cache control still be in effective.

However, if this happens in server http response header, it usually means this request is, in fact, a CGI response. The cache feature is then unconditionally disabled for this session.

2) If-mod-since

If the client issue "If-mod-since", but the cache stored is newly than "cache_fast_timeout" (default to 5min), the cache is considered to be valid without sending a request to the final destination server for further validation.

However, if the client did not issue "If-mod-since", and the cache is older than "cache_timeout" (default to 24hr), the cache is considered to be expired, and a request would be send to the final destination server even the cached stored is valid for the client request.

You can change the values of "cache_fast_timeout" and "cache_timeout" in General Config options.

3) Config options

The Server Config option, $cache = enable/disable, control the overall setting of the cache feature.

4) Password Protected Pages

If the web documents are password protected by either WWW-Authorization or Proxy-Authorization, all caching will be disabled.

5) Cache-control

If there is any "cache-control" header but is NOT equals to "public", then the caching will be disabled.


[Sam Ng Home] [twhttpd Home]

Last Modified: 2001-12-08