--- lighttpd-1.4.22/src/mod_expire.c 2009-02-19 15:15:14.000000000 +0200 +++ /usr/src/lighttpd-1.4.22/src/mod_expire.c 2009-05-10 12:49:34.000000000 +0300 @@ -302,7 +302,7 @@ if (ds->key->used == 0) continue; if (0 == strncmp(con->uri.path->ptr, ds->key->ptr, ct_len)) { - int ts; + int ts, tc; time_t t; size_t len; stat_cache_entry *sce = NULL; @@ -313,11 +313,13 @@ case 0: /* access */ t = (ts + srv->cur_ts); + tc = ts; break; case 1: /* modification */ t = (ts + sce->st.st_mtime); + tc = t - srv->cur_ts; break; default: /* -1 is handled at parse-time */ @@ -340,7 +342,7 @@ /* HTTP/1.1 */ buffer_copy_string_len(p->expire_tstmp, CONST_STR_LEN("max-age=")); - buffer_append_long(p->expire_tstmp, ts); + buffer_append_long(p->expire_tstmp, tc); response_header_overwrite(srv, con, CONST_STR_LEN("Cache-Control"), CONST_BUF_LEN(p->expire_tstmp));