httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject cvs commit: httpd-2.0/modules/experimental cache_storage.c mod_cache.c mod_cache.h mod_mem_cache.c mod_mem_cache.dsp
Date Fri, 04 Jan 2002 17:58:36 GMT
ianh        02/01/04 09:58:36

  Modified:    modules/experimental cache_storage.c mod_cache.c mod_cache.h
                        mod_mem_cache.c mod_mem_cache.dsp
  Log:
  cache now can cache things for minutes.
  add remove_entity function to type on mem_cache (so we can remove items from the cache)
  
  Revision  Changes    Path
  1.9       +0 -2      httpd-2.0/modules/experimental/cache_storage.c
  
  Index: cache_storage.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/cache_storage.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- cache_storage.c	11 Sep 2001 17:41:05 -0000	1.8
  +++ cache_storage.c	4 Jan 2002 17:58:36 -0000	1.9
  @@ -173,11 +173,9 @@
                */
   
               /* Has the cache entry expired? */
  -#if 0
               if (r->request_time > info->expire)
                   cache->fresh = 0;
               else
  -#endif
                   cache->fresh = 1;
   
               /*** do content negotiation here */
  
  
  
  1.18      +35 -2     httpd-2.0/modules/experimental/mod_cache.c
  
  Index: mod_cache.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_cache.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- mod_cache.c	11 Sep 2001 17:41:05 -0000	1.17
  +++ mod_cache.c	4 Jan 2002 17:58:36 -0000	1.18
  @@ -591,6 +591,9 @@
                        "cache: Added date header");
           info->date = date;
       }
  +    else {
  +        date = info->date;
  +    }
   
       /* set response_time for HTTP/1.1 age calculations */
       info->response_time = now;
  @@ -622,7 +625,7 @@
       if (exp == APR_DATE_BAD) {
           if (lastmod != APR_DATE_BAD) {
               double x = (double) (date - lastmod) * conf->factor;
  -            double maxex = conf->maxex;
  +            double maxex = (double)conf->maxex;
               if (x > maxex)
                   x = maxex;
               exp = now + (int) x;
  @@ -742,6 +745,18 @@
       conf->maxex_set = 1;
       return NULL;
   }
  +static const char
  +*set_cache_maxex_min(cmd_parms *parms, void *dummy, const char *arg)
  +{
  +    cache_server_conf *conf = ap_get_module_config(parms->server->module_config,
&cache_module);
  +    long val;
  +
  +    val = atol(arg);
  +
  +    conf->maxex = (apr_time_t) (val * MSEC_ONE_MIN);
  +    conf->maxex_set = 1;
  +    return NULL;
  +}
   
   static const char
   *set_cache_defex(cmd_parms *parms, void *dummy, const char *arg)
  @@ -755,6 +770,18 @@
       conf->defex_set = 1;
       return NULL;
   }
  +static const char
  +*set_cache_defex_min(cmd_parms *parms, void *dummy, const char *arg)
  +{
  +    cache_server_conf *conf = ap_get_module_config(parms->server->module_config,
&cache_module);
  +    long val;
  +
  +    val = atol(arg);
  +
  +    conf->defex = (apr_time_t) (val * MSEC_ONE_MIN);
  +    conf->defex_set = 1;
  +    return NULL;
  +}
   
   static const char
   *set_cache_factor(cmd_parms *parms, void *dummy, const char *arg)
  @@ -801,8 +828,14 @@
        "A partial URL prefix below which caching is disabled"),
       AP_INIT_TAKE1("CacheMaxExpire", set_cache_maxex, NULL, RSRC_CONF,
        "The maximum time in hours to cache a document"),
  -    AP_INIT_TAKE1("CacheDefaultExpire", set_cache_defex, NULL, RSRC_CONF,
  +    AP_INIT_TAKE1("CacheMaxExpireMin", set_cache_maxex_min, NULL, RSRC_CONF,
  +     "The maximum time in Minutes to cache a document"),
  +
  +     AP_INIT_TAKE1("CacheDefaultExpire", set_cache_defex, NULL, RSRC_CONF,
        "The default time in hours to cache a document"),
  +     AP_INIT_TAKE1("CacheDefaultExpireMin", set_cache_defex_min, NULL, RSRC_CONF,
  +     "The default time in Minutes to cache a document"),
  +
       AP_INIT_TAKE1("CacheLastModifiedFactor", set_cache_factor, NULL, RSRC_CONF,
        "The factor used to estimate Expires date from LastModified date"),
       AP_INIT_TAKE1("CacheForceCompletion", set_cache_complete, NULL, RSRC_CONF,
  
  
  
  1.12      +1 -1      httpd-2.0/modules/experimental/mod_cache.h
  
  Index: mod_cache.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_cache.h,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- mod_cache.h	4 Dec 2001 01:45:46 -0000	1.11
  +++ mod_cache.h	4 Jan 2002 17:58:36 -0000	1.12
  @@ -120,7 +120,7 @@
   
   #define MSEC_ONE_DAY ((apr_time_t)(86400*APR_USEC_PER_SEC)) /* one day, in microseconds
*/
   #define MSEC_ONE_HR  ((apr_time_t)(3600*APR_USEC_PER_SEC))  /* one hour, in microseconds
*/
  -
  +#define MSEC_ONE_MIN  ((apr_time_t)(60*APR_USEC_PER_SEC))   /* one minute, in microseconds
*/
   #define DEFAULT_CACHE_MAXEXPIRE MSEC_ONE_DAY
   #define DEFAULT_CACHE_EXPIRE    MSEC_ONE_HR
   #define DEFAULT_CACHE_LMFACTOR (0.1)
  
  
  
  1.12      +2 -0      httpd-2.0/modules/experimental/mod_mem_cache.c
  
  Index: mod_mem_cache.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_mem_cache.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- mod_mem_cache.c	5 Dec 2001 15:01:15 -0000	1.11
  +++ mod_mem_cache.c	4 Jan 2002 17:58:36 -0000	1.12
  @@ -291,6 +291,7 @@
       h->read_headers = &read_headers;
       h->write_body = &write_body;
       h->write_headers = &write_headers;
  +    h->remove_entity = &remove_entity;
   
       return OK;
   }
  @@ -320,6 +321,7 @@
       h->read_headers = &read_headers;
       h->write_body = &write_body;
       h->write_headers = &write_headers;
  +    h->remove_entity = &remove_entity;
       h->cache_obj = obj;
   
       return OK;
  
  
  
  1.2       +1 -1      httpd-2.0/modules/experimental/mod_mem_cache.dsp
  
  Index: mod_mem_cache.dsp
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_mem_cache.dsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- mod_mem_cache.dsp	4 Jan 2002 06:01:23 -0000	1.1
  +++ mod_mem_cache.dsp	4 Jan 2002 17:58:36 -0000	1.2
  @@ -69,7 +69,7 @@
   # PROP Ignore_Export_Lib 0
   # PROP Target_Dir ""
   # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D
"_MBCS" /D "_USRDLL" /D "mod_mem_cache_EXPORTS" /YX /FD /GZ /c
  -# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "../../srclib/apr-util/include" /I "../../srclib/apr/include"
/I "../../include" /I "../../os/win32" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D
"_USRDLL" /YX /FD /GZ /c
  +# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "../../srclib/apr-util/include" /I "../../srclib/apr/include"
/I "../../include" /I "../../os/win32" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D
"_USRDLL" /FR /YX /FD /GZ /c
   # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
   # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
   # ADD BASE RSC /l 0x409 /d "_DEBUG"
  
  
  

Mime
View raw message