Выставленный вручную Last-Modified не поддерживается в протоколе

Oleksandr V. Typlyns'kyi wangsamp at gmail.com
Fri Oct 3 23:06:43 MSD 2008


Today Oct 3, 2008 at 19:55 Igor Shergin wrote:

> Конечно, возможность добавить хедер не обязует nginx обрабатывать ответ на
> него, но такое поведение лишает фичу смысла чуть более, чем полностью. :-)

  Вы сами ответили на свой вопрос - ручная установка заголовка влияет только на его выдачу в ответе.
  Однако есть иной нюанс.

 wget -S --header="If-Modified-Since: Mon, 07 Jul 2008 10:10:11 GMT" http://i.bigmir.net/favicon.ico
  HTTP/1.1 304 Not Modified
  Server: nginx
  Date: Fri, 03 Oct 2008 18:56:01 GMT
  Last-Modified: Mon, 07 Jul 2008 10:10:11 GMT
  Connection: keep-alive
  Keep-Alive: timeout=15
  Expires: Thu, 31 Dec 2037 23:55:55 GMT
  Cache-Control: max-age=315360000
  
 wget -S --header="If-Modified-Since: Mon, 07 Jul 2008 10:10:12 GMT" http://i.bigmir.net/favicon.ico
  HTTP/1.1 200 OK
  Server: nginx
  Date: Fri, 03 Oct 2008 18:56:05 GMT
  Content-Type: image/x-icon
  Content-Length: 1150
  Last-Modified: Mon, 07 Jul 2008 10:10:11 GMT
  Connection: keep-alive
  Keep-Alive: timeout=15
  Expires: Thu, 31 Dec 2037 23:55:55 GMT
  Cache-Control: max-age=315360000
  Accept-Ranges: bytes

 Из http/modules/ngx_http_not_modified_filter_module.c:

    /*
     * I think that the equality of the dates is correcter
     */

 if (ims == r->headers_out.last_modified_time) { 
     r->headers_out.status = NGX_HTTP_NOT_MODIFIED;
     r->headers_out.content_type.len = 0;
     ngx_http_clear_content_length(r);
     ngx_http_clear_accept_ranges(r);
 }

 Может стоит изменить условие на >= ?
 
-- 
WNGS-RIPE





More information about the nginx-ru mailing list