Klaus Demo nginx / 3a8f4c1
Merge of r4217, r4218: Fixed "expires @00h". Fixed "expires @time" with unknown last modified time (ticket #32). Maxim Dounin 10 years ago
1 changed file(s) with 7 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
252252 return NGX_ERROR;
253253 }
254254
255 if (conf->expires_time == 0) {
255 if (conf->expires_time == 0 && conf->expires != NGX_HTTP_EXPIRES_DAILY) {
256256 ngx_memcpy(expires->value.data, ngx_cached_http_time.data,
257257 ngx_cached_http_time.len + 1);
258258 ngx_str_set(&cc->value, "max-age=0");
261261
262262 now = ngx_time();
263263
264 if (conf->expires == NGX_HTTP_EXPIRES_ACCESS
265 || r->headers_out.last_modified_time == -1)
264 if (conf->expires == NGX_HTTP_EXPIRES_DAILY) {
265 expires_time = ngx_next_time(conf->expires_time);
266 max_age = expires_time - now;
267
268 } else if (conf->expires == NGX_HTTP_EXPIRES_ACCESS
269 || r->headers_out.last_modified_time == -1)
266270 {
267271 expires_time = now + conf->expires_time;
268272 max_age = conf->expires_time;
269
270 } else if (conf->expires == NGX_HTTP_EXPIRES_DAILY) {
271 expires_time = ngx_next_time(conf->expires_time);
272 max_age = expires_time - now;
273273
274274 } else {
275275 expires_time = r->headers_out.last_modified_time + conf->expires_time;