/*
- * $Id: client_side.cc,v 1.324 1998/06/02 22:15:19 rousskov Exp $
+ * $Id: client_side.cc,v 1.325 1998/06/02 22:45:03 rousskov Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
/* Handle Ranges */
if (http->request->range)
clientBuildRangeHeader(http, rep);
+ /* Add Age header, not that our header must replace Age headers from other caches if any */
+ if (http->entry->timestamp <= squid_curtime) {
+ httpHeaderDelById(hdr, HDR_AGE);
+ /* we do not follow HTTP/1.1 precisely here becuase we rely on Date
+ * header when computing entry->timestamp; we should be using _request_ time
+ * if Date header is not available */
+ httpHeaderPutInt(hdr, HDR_AGE, squid_curtime - http->entry->timestamp);
+ } else {
+ debug(33, 1) ("clientBuildReplyHeader: entry's timestamp is invalid: %d ? %d\n",
+ http->entry->timestamp, squid_curtime);
+ }
/* Append X-Cache */
httpHeaderPutStrf(hdr, HDR_X_CACHE, "%s from %s",
is_hit ? "HIT" : "MISS", getMyHostname());