comparison src/http/modules/ngx_http_not_modified_filter_module.c @ 2496:9081bbdccda1

if_modified_since off
author Igor Sysoev <igor@sysoev.ru>
date Tue, 10 Feb 2009 15:05:05 +0000
parents c59485781f0a
children 3a8a53c0c42f
comparison
equal deleted inserted replaced
2495:a59b26eee816 2496:9081bbdccda1
59 || r->headers_out.last_modified_time == -1) 59 || r->headers_out.last_modified_time == -1)
60 { 60 {
61 return ngx_http_next_header_filter(r); 61 return ngx_http_next_header_filter(r);
62 } 62 }
63 63
64 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
65
66 if (clcf->if_modified_since == NGX_HTTP_IMS_OFF) {
67 return ngx_http_next_header_filter(r);
68 }
69
64 ims = ngx_http_parse_time(r->headers_in.if_modified_since->value.data, 70 ims = ngx_http_parse_time(r->headers_in.if_modified_since->value.data,
65 r->headers_in.if_modified_since->value.len); 71 r->headers_in.if_modified_since->value.len);
66 72
67 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 73 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
68 "http ims:%d lm:%d", ims, r->headers_out.last_modified_time); 74 "http ims:%d lm:%d", ims, r->headers_out.last_modified_time);
69 75
70 if (ims != r->headers_out.last_modified_time) { 76 if (ims != r->headers_out.last_modified_time) {
71 77
72 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); 78 if (clcf->if_modified_since == NGX_HTTP_IMS_EXACT
73
74 if (clcf->if_modified_since == 0
75 || ims < r->headers_out.last_modified_time) 79 || ims < r->headers_out.last_modified_time)
76 { 80 {
77 return ngx_http_next_header_filter(r); 81 return ngx_http_next_header_filter(r);
78 } 82 }
79 } 83 }