View | Details | Raw Unified | Return to bug 15852
Collapse All | Expand All

(-)server/util_script.c (+6 lines)
Lines 591-596 Link Here
591
	else if (!strcasecmp(w, "Transfer-Encoding")) {
591
	else if (!strcasecmp(w, "Transfer-Encoding")) {
592
	    apr_table_set(r->headers_out, w, l);
592
	    apr_table_set(r->headers_out, w, l);
593
	}
593
	}
594
	else if (!strcasecmp(w, "Age")) { 	
595
	    apr_table_set(r->headers_out, w, l);
596
	}
597
	else if (!strcasecmp(w, "Expires")) {  
598
	    apr_table_set(r->headers_out, w, l);
599
	}
594
	/*
600
	/*
595
	 * If the script gave us a Last-Modified header, we can't just
601
	 * If the script gave us a Last-Modified header, we can't just
596
	 * pass it on blindly because of restrictions on future values.
602
	 * pass it on blindly because of restrictions on future values.
(-)modules/experimental/cache_util.c (+16 lines)
Lines 164-169 Link Here
164
    apr_int64_t age, maxage_req, maxage_cresp, maxage, smaxage, maxstale, minfresh;
164
    apr_int64_t age, maxage_req, maxage_cresp, maxage, smaxage, maxstale, minfresh;
165
    const char *cc_cresp, *cc_req, *pragma_cresp;
165
    const char *cc_cresp, *cc_req, *pragma_cresp;
166
    const char *agestr = NULL;
166
    const char *agestr = NULL;
167
    const char *exps;
167
    char *val;
168
    char *val;
168
    apr_time_t age_c = 0;
169
    apr_time_t age_c = 0;
169
    cache_info *info = &(cache->handle->cache_obj->info);
170
    cache_info *info = &(cache->handle->cache_obj->info);
Lines 208-213 Link Here
208
        age_c = apr_atoi64(agestr);
209
        age_c = apr_atoi64(agestr);
209
    }
210
    }
210
211
212
    /* Extract "Expires" from the response header for determining Heuristic expiration condition */
213
    exps = apr_table_get(r->headers_out, "Expires");
214
211
    /* calculate age of object */
215
    /* calculate age of object */
212
    age = ap_cache_current_age(info, age_c, r->request_time);
216
    age = ap_cache_current_age(info, age_c, r->request_time);
213
217
Lines 275-280 Link Here
275
            /* make sure we don't stomp on a previous warning */
279
            /* make sure we don't stomp on a previous warning */
276
            apr_table_merge(r->headers_out, "Warning", "110 Response is stale");
280
            apr_table_merge(r->headers_out, "Warning", "110 Response is stale");
277
        }
281
        }
282
283
	/* 
284
	 * If none of Expires, Cache-Control: max-age, or Cache-Control: 
285
	 * s-maxage appears in the response, and the respose header age 
286
	 * calculated is more than 24 hours add the warning 113 
287
	 */
288
	if((maxage_cresp == -1) && (smaxage == -1) &&
289
	    (exps == NULL) && (age_c > 86400)) {
290
	    apr_table_merge(r->headers_out, "Warning", "113 Heuristic expiration");
291
	}
292
293
278
        return 1;    /* Cache object is fresh */
294
        return 1;    /* Cache object is fresh */
279
    }
295
    }
280
    return 0;        /* Cache object is stale */
296
    return 0;        /* Cache object is stale */

Return to bug 15852