diff -N -c -r -X exclude_files squid-1.0.beta7/doc/HTTP-codes.txt squid-1.0.beta7.henrik/doc/HTTP-codes.txt
*** squid-1.0.beta7/doc/HTTP-codes.txt	Thu Jan  1 01:00:00 1970
--- squid-1.0.beta7.henrik/doc/HTTP-codes.txt	Sun May 19 21:00:44 1996
***************
*** 0 ****
--- 1,50 ----
+ Caching  Code
+ 	Successful 2xx
+ c        200 OK
+          201 Created
+          202 Accepted
+ c        203 Non-Authoriative Information *
+ E        204 No Content
+          205 Reset Content *
+          206 Partial Content *
+ 	Redirection 3xx
+ C        300 Multiple Choices
+ C        301 Moved Permanently
+ t        302 Moved Temporarily
+ -        303 See Other *
+ -        304 Not Modified
+ E        305 Use Proxy (proxy redirect) *
+         Client Error 4xx
+ E        400 Bad Request
+ -        401 Unauthorized
+          402 Payment Required *
+ E        403 Forbidden
+ E        404 Not Found
+ E        405 Method Not Allowed *
+          406 Not Acceptable *
+ -        407 Proxy Authentication Required *
+          408 Request Timeout *
+          409 Confict *
+ C        410 Gone *
+          411 Length Required *
+          412 Precondition Failed *
+          413 Request Entity To Large *
+ E        414 Request-URI Too Long *
+          415 Unsupported Media Type
+         Server Error 5xx
+ E        500 Internal Server Error
+ E        501 Not Implemented
+ E        502 Bad Gateway
+ E        503 Service Unavailable
+ E        504 Gateway Timeout *
+          505 HTTP Version Not Supported *
+ 
+ Notes:
+ * HTTP 1.1
+ c Cached unless a query response without expiry information
+ C Cached
+ E Negatively cached if no expiry headers.
+ t Cached only if expiry information
+ - Not cached
+ 
+ Unless other said, the response code is not cached.
diff -N -c -r -X exclude_files squid-1.0.beta7/doc/Release-Notes-1.0.txt squid-1.0.beta7.henrik/doc/Release-Notes-1.0.txt
*** squid-1.0.beta7/doc/Release-Notes-1.0.txt	Wed Apr 24 17:29:08 1996
--- squid-1.0.beta7.henrik/doc/Release-Notes-1.0.txt	Sun May 19 22:03:36 1996
***************
*** 65,96 ****
  
  Squid parses HTTP replies to extract the reply code.  The codes are used
  to determine which objects should be cached, which should be ejected,
! and which should be negative-cached.  Currently, the following are
! hard-coded:
  
!     These could be cached for a long time:
! 	200 OK
! 	203 Non-Authoritative Information
! 	300 Multiple Choices
! 	301 Moved Permanently
! 	410 Gone
! 
!     These are ejected immediately:
! 	304 Not Modified
! 	401 Unauthorized
! 	407 Proxy Authentication Required
! 
!     All others are negative-cached (for whatever is configured, default
!     five minutes).  They include:
! 	302 Moved Temporarily
! 	400 Bad Request
! 	403 Forbidden
! 	404 Not Found
! 	500 Internal Server Error
  
  The HTTP codes are now logged to "access.log" in the native format 
  (ie with 'emulate_httpd_log off').
- 
  
  Support for If-Modified-Since GET
  ==============================================================================
--- 65,77 ----
  
  Squid parses HTTP replies to extract the reply code.  The codes are used
  to determine which objects should be cached, which should be ejected,
! and which should be negative-cached. 
  
! See HTTP-codes.txt for a list of HTTP response codes, and how they are
! cached.
  
  The HTTP codes are now logged to "access.log" in the native format 
  (ie with 'emulate_httpd_log off').
  
  Support for If-Modified-Since GET
  ==============================================================================
diff -N -c -r -X exclude_files squid-1.0.beta7/src/http.c squid-1.0.beta7.henrik/src/http.c
*** squid-1.0.beta7/src/http.c	Thu May  9 01:23:25 1996
--- squid-1.0.beta7.henrik/src/http.c	Sun May 19 21:43:48 1996
***************
*** 95,100 ****
--- 95,129 ----
      comm_close(fd);
  }
  
+ /* This object can be cached for a long time */
+ static void httpMakePublic(entry)
+      StoreEntry *entry;
+ {
+     entry->expires = squid_curtime + ttlSet(entry);
+     if (BIT_TEST(entry->flag, CACHABLE))
+ 	storeSetPublicKey(entry);
+ }
+ 
+ /* This object should never be cached at all */
+ static void httpMakePrivate(entry)
+      StoreEntry *entry;
+ {
+     storeSetPrivateKey(entry);
+     storeExpireNow(entry);
+     BIT_RESET(entry->flag, CACHABLE);
+     storeReleaseRequest(entry); /* delete object when not used */
+ }
+     
+ /* This object may be negatively cached */
+ static void httpCacheNegatively(entry)
+      StoreEntry *entry;
+ {
+     entry->expires = squid_curtime + getNegativeTTL();
+     if (BIT_TEST(entry->flag, CACHABLE))
+ 	storeSetPublicKey(entry);
+     /* XXX: mark object "not to store on disk"? */
+ }
+ 
  
  static void httpProcessReplyHeader(data, buf, size)
       HttpData *data;
***************
*** 193,222 ****
  	if (reply->code)
  	    debug(11, 3, "httpProcessReplyHeader: HTTP CODE: %d\n", reply->code);
  	switch (reply->code) {
! 	case 200:		/* OK */
! 	case 203:		/* Non-Authoritative Information */
! 	case 300:		/* Multiple Choices */
! 	case 301:		/* Moved Permanently */
! 	case 410:		/* Gone */
! 	    /* These can be cached for a long time, make the key public */
! 	    entry->expires = squid_curtime + ttlSet(entry);
! 	    if (BIT_TEST(entry->flag, CACHABLE))
! 		storeSetPublicKey(entry);
  	    break;
! 	case 304:		/* Not Modified */
! 	case 401:		/* Unauthorized */
! 	case 407:		/* Proxy Authentication Required */
! 	    /* These should never be cached at all */
! 	    storeSetPrivateKey(entry);
! 	    storeExpireNow(entry);
! 	    BIT_RESET(entry->flag, CACHABLE);
! 	    storeReleaseRequest(entry);
  	    break;
! 	default:
! 	    /* These can be negative cached, make key public */
! 	    entry->expires = squid_curtime + getNegativeTTL();
! 	    if (BIT_TEST(entry->flag, CACHABLE))
! 		storeSetPublicKey(entry);
  	    break;
  	}
      }
--- 222,271 ----
  	if (reply->code)
  	    debug(11, 3, "httpProcessReplyHeader: HTTP CODE: %d\n", reply->code);
  	switch (reply->code) {
! 	/* Responses that are cacheable */
! 	case 200:	/* OK */
! 	case 203:	/* Non-Authoritative Information */
! 	case 300:	/* Multiple Choices */
! 	case 301:	/* Moved Permanently */
! 	case 410:	/* Gone */
! 	    /* These can be cached for a long time */
! 	    httpMakePublic(entry);
! 	    break;
! 	/* Responses that only are cacheable if the server says so */
! 	case 302:	/* Moved temporarily */
! 	    if(*reply->expires) {
! 		httpMakePublic(entry);
! 	    } else {
! 	    	httpMakePrivate(entry);
! 	    }
  	    break;
! 	/* Errors can be negatively cached */
! 	case 204:	/* No Content */
! 	case 305:	/* Use Proxy (proxy redirect) */
! 	case 400:	/* Bad Request */
! 	case 403:	/* Forbidden */
! 	case 404:	/* Not Found */
! 	case 405:	/* Method Now Allowed */
! 	case 414:	/* Request-URI Too Long */
! 	case 500:	/* Internal Server Error */
! 	case 501:	/* Not Implemented */
! 	case 502:	/* Bad Gateway */
! 	case 503:	/* Service Unavailable */
! 	case 504:	/* Gateway Timeout */
! 	    if(*reply->expires) {
! 	    	/* Use expiry information if available */
! 		httpMakePublic(entry);
! 	    } else {
! 	    	httpCacheNegatively(entry);
! 	    }
  	    break;
! 	/* Some responses can never be cached */
! 	case 303:	/* See Other */
! 	case 304:	/* Not Modified */
! 	case 401:	/* Unauthorized */
! 	case 407:	/* Proxy Authentication Required */
! 	default:	/* Unknown status code */
! 	    httpMakePrivate(entry);
  	    break;
  	}
      }
