Branch: Tag:

2002-11-02

2002-11-02 03:25:24 by Martin Nilsson <mani@lysator.liu.se>

Don't return "Not Modified" (304) if misc->cacheable has been lowered.
This prevents always sending 304 answers to a browser supplying a
if-modified-since header when the page is expected to expire due to
some dynamic RXML. However, if the expire time isn't lowered below
INITIAL_CACHEABLE (5 min) the browser will still get 304 answers
forever (or until the page really is modified).

Set expire time to 1970 if misc->cacheable is 0. This avoids problem
with immediate expiration and clock skew between server and client for
browsers using HTTP/1.0.

Rev: server/plugins/protocols/http.pike:1.390

2:   // Modified by Francesco Chemolli to add throttling capabilities.   // Copyright © 1996 - 2001, Roxen IS.    - constant cvs_version = "$Id: http.pike,v 1.389 2002/10/30 19:36:12 nilsson Exp $"; + constant cvs_version = "$Id: http.pike,v 1.390 2002/11/02 03:25:24 mani Exp $";   // #define REQUEST_DEBUG   #define MAGIC_ERROR   
1498:    }       if( misc->cacheable < INITIAL_CACHEABLE ) { +  if (misc->cacheable == 0) +  heads["Expires"] = Roxen.http_date( 0 ); +  else    heads["Expires"] = Roxen.http_date( predef::time(1)+misc->cacheable );       if (!misc->cacheable && !misc->last_modified) {
1527:   // misc->cacheable);    if ( ((since_info[0] >= misc->last_modified) &&    ((since_info[1] == -1) || (since_info[1] == file->len))) -  // never say 'not modified' if not cacheable at all. -  && (misc->cacheable != 0) +  // never say 'not modified' if cacheable has been lowered. +  && (misc->cacheable >= INITIAL_CACHEABLE)    // actually ok, or...   // || ((misc->cacheable>0)   // && (since_info[0] + misc->cacheable<= predef::time(1))