Branch: Tag:

2000-08-17

2000-08-17 00:38:34 by Per Hedbor <ph@opera.com>

Always stat() the file before sending from cache. It only slows things down ~20%, and really helps when developing pages...

Rev: server/protocols/http.pike:1.249

2:   // Modified by Francesco Chemolli to add throttling capabilities.   // Copyright © 1996 - 2000, Roxen IS.    - constant cvs_version = "$Id: http.pike,v 1.248 2000/08/16 22:53:28 per Exp $"; + constant cvs_version = "$Id: http.pike,v 1.249 2000/08/17 00:38:34 per Exp $";   // #define REQUEST_DEBUG   #define MAGIC_ERROR   #define RAM_CACHE
1836: Inside #if defined(RAM_CACHE)
   "hs":strlen(head_string),    "len":file->len,    "error":file->error, +  "mtime":(file->stat && file->stat[ST_MTIME]), +  "rf":realfile,    ]),    misc->cacheable );    file = ([ "data":data ]);
2076: Inside #if defined(RAM_CACHE)
   {    if(!leftovers)    leftovers = data||""; +     string d = cv[ 0 ];    file = cv[1]; -  +  array st; +  if( !file->rf || !file->mtime || +  ((st = file_stat( file->rf )) && +  st[ST_MTIME] == file->mtime ) ) +  {    conf->hsent += file->hs;    if( strlen( d ) < 4000 )    {
2091: Inside #if defined(RAM_CACHE)
   }    return;    } +  file = 0; +  }   #endif       TIMER("pre_handle");