You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by Dean Gaudet <dg...@hyperreal.com> on 1997/06/28 23:45:11 UTC

cvs commit: apache/src CHANGES mod_expires.c

dgaudet     97/06/28 14:45:10

  Modified:    src       CHANGES mod_expires.c
  Log:
  Issue cache-control: max-age headers, and optimize the handler.
  
  Submitted by:	Rob Hartill
  Reviewed by:	Dean Gaudet
  
  Revision  Changes    Path
  1.302     +11 -7     apache/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /export/home/cvs/apache/src/CHANGES,v
  retrieving revision 1.301
  retrieving revision 1.302
  diff -C3 -r1.301 -r1.302
  *** CHANGES	1997/06/28 20:24:26	1.301
  --- CHANGES	1997/06/28 21:45:09	1.302
  ***************
  *** 1,16 ****
    Changes with Apache 1.3
    
      *) Added IconHeight and IconWidth to mod_dir's IndexOptions directive.
         When used together, these cause mod_dir to emit HEIGHT and WIDTH
         attributes in the FancyIndexing IMG tags.  [Ken Coar]
    
  !   *) Added NT support [Ben Laurie and Ambarish Malpani <am...@valicert.com>]
  ! 
  !   *) mod_auth deals with extra ':' delimited fields.  [Marc Slemko]
  ! 
  !   *) Added kill_only_once option for free_proc_chain so that it won't
  !      aggressively try to kill off specific children.  For fastcgi.
  !      [Stanley Gambarin <ga...@OpenMarket.com>]
    
    Changes with Apache 1.2.1
    
  --- 1,20 ----
    Changes with Apache 1.3
  +   
  +   *) mod_expire also issues Cache-Control: max-age headers.
  +      [Rob Hartill]
  + 
  +   *) Added kill_only_once option for free_proc_chain so that it won't
  +      aggressively try to kill off specific children.  For fastcgi.
  +      [Stanley Gambarin <ga...@OpenMarket.com>]
  + 
  +   *) mod_auth deals with extra ':' delimited fields.  [Marc Slemko]
    
      *) Added IconHeight and IconWidth to mod_dir's IndexOptions directive.
         When used together, these cause mod_dir to emit HEIGHT and WIDTH
         attributes in the FancyIndexing IMG tags.  [Ken Coar]
    
  !   *) PORT: Added NT support
  !      [Ben Laurie and Ambarish Malpani <am...@valicert.com>]
    
    Changes with Apache 1.2.1
    
  
  
  
  1.9       +12 -5     apache/src/mod_expires.c
  
  Index: mod_expires.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/mod_expires.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -C3 -r1.8 -r1.9
  *** mod_expires.c	1997/06/17 00:09:14	1.8
  --- mod_expires.c	1997/06/28 21:45:09	1.9
  ***************
  *** 384,401 ****
    
    int add_expires(request_rec *r)
    {
  !     expires_dir_config *conf =
  !             (expires_dir_config *)get_module_config(r->per_dir_config, &expires_module);
        char *code;
        time_t base; 
        time_t additional; 
        time_t expires; 
    
  !     if ( r->finfo.st_mode == 0 )
    	return DECLINED;
    
  !     /* COMMA bites my ass...
  !      */
        if ( conf == NULL ) {
            log_reason ("internal error in expires_module; add_expires(), conf == NULL", r->filename, r);
    	return SERVER_ERROR;
  --- 384,406 ----
    
    int add_expires(request_rec *r)
    {
  !     expires_dir_config *conf;
        char *code;
        time_t base; 
        time_t additional; 
        time_t expires; 
  +     char age[20];
    
  !     if (is_HTTP_ERROR(r->status))  /* Don't add Expires headers to errors */
    	return DECLINED;
    
  !     if (r->main != NULL)           /* Say no to subrequests */
  ! 	return DECLINED;
  ! 
  !     if ( r->finfo.st_mode == 0 )     /* no file ? shame. */
  ! 	return DECLINED;
  ! 
  !     conf = (expires_dir_config *)get_module_config(r->per_dir_config, &expires_module);
        if ( conf == NULL ) {
            log_reason ("internal error in expires_module; add_expires(), conf == NULL", r->filename, r);
    	return SERVER_ERROR;
  ***************
  *** 451,456 ****
  --- 456,463 ----
        };
    
        expires = base + additional;
  +     ap_snprintf(age, sizeof(age), "max-age=%d", (int)expires - (int)time(NULL));
  +     table_set( r->headers_out, "Cache-Control", age);
        tzset();	/* redundant? called implicitly by localtime, at least 
    		 * under FreeBSD
    		 */