When Last-Modified is unknown, you can still use ETags, but you need a short string that is unique for that content. In the worst case, you have to generate all the content first, then instantiate HTTP_ConditionalGet, setting the array key contentHash to the output of a hash function of the content. Since we have the full content, we might as well also use setContentLength(strlen($content)) in the case where we need to send it.

This script emulates a document that changes every ' .$every. ' seconds.
This is version: ' . date('r', $lastModified) . '

'; require '_include.php'; $content = get_content(array( 'title' => $title ,'explain' => $explain )); $cg = new HTTP_ConditionalGet(array( 'contentHash' => substr(md5($content), 7) )); if ($cg->cacheIsValid) { $cg->sendHeaders(); // we're done exit(); } $cg->setContentLength(strlen($content)); $cg->sendHeaders(); send_slowly($content);