*** mod_cache.c	Fri May 16 00:16:43 2003
--- ../../../httpd-2.0.47-dev.modif/modules/experimental/mod_cache.c	Thu Jun 12 16:15:21 2003
***************
*** 96,102 ****
      char *url = r->unparsed_uri;
      apr_size_t urllen;
      char *path = uri.path;
!     const char *types;
      cache_info *info = NULL;
      cache_request_rec *cache;
      cache_server_conf *conf;
--- 96,102 ----
      char *url = r->unparsed_uri;
      apr_size_t urllen;
      char *path = uri.path;
!     const char *types, *lastmods, *etag;
      cache_info *info = NULL;
      cache_request_rec *cache;
      cache_server_conf *conf;
***************
*** 250,255 ****
--- 250,257 ----
              return OK;
          }
          else {
+ 	    lastmods = apr_table_get(r->headers_out, "Last-Modified");
+ 	    etag = apr_table_get(r->err_headers_out, "Etag");
  	    r->err_headers_out = apr_table_make(r->pool, 3);
              /* stale data available */
              if (lookup) {
***************
*** 273,287 ****
              /* else if non-conditional request */
              else {
                  /* fudge response into a conditional */
!                 if (info && info->etag) {
                      ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, 
                                   r->server,
                                   "cache: nonconditional - fudge conditional "
                                   "by etag");
                      /* if we have a cached etag */
!                     apr_table_set(r->headers_in, "If-None-Match", info->etag);
                  }
!                 else if (info && info->lastmods) {
                      ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, 
                                   r->server,
                                   "cache: nonconditional - fudge conditional "
--- 275,289 ----
              /* else if non-conditional request */
              else {
                  /* fudge response into a conditional */
!                 if (etag) {
                      ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, 
                                   r->server,
                                   "cache: nonconditional - fudge conditional "
                                   "by etag");
                      /* if we have a cached etag */
!                     apr_table_set(r->headers_in, "If-None-Match", etag);
                  }
!                 else if (lastmods) {
                      ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, 
                                   r->server,
                                   "cache: nonconditional - fudge conditional "
***************
*** 289,295 ****
                      /* if we have a cached IMS */
                      apr_table_set(r->headers_in, 
                                    "If-Modified-Since", 
!                                   info->lastmods);
                  }
                  else {
                      /* something else - pretend there was no cache */
--- 291,297 ----
                      /* if we have a cached IMS */
                      apr_table_set(r->headers_in, 
                                    "If-Modified-Since", 
!                                   lastmods);
                  }
                  else {
                      /* something else - pretend there was no cache */
