diff options
| author | Sascha Schumann <sas@php.net> | 2001-12-10 13:31:41 +0000 |
|---|---|---|
| committer | Sascha Schumann <sas@php.net> | 2001-12-10 13:31:41 +0000 |
| commit | ef72a765bf01f12d22b1eb6bdf96ccc589cfa0bc (patch) | |
| tree | efd64daa1f2007709e979f07d77e2f7d3a8dc22c /sapi/thttpd/thttpd_patch | |
| parent | 737b6f8b130060c9482f693313316ffbc540fa48 (diff) | |
| download | php-git-ef72a765bf01f12d22b1eb6bdf96ccc589cfa0bc.tar.gz | |
Add a nocache feature: If documents are stored under /nocache/,
appropiate HTTP headers will be sent which prevent client/proxy caching.
Diffstat (limited to 'sapi/thttpd/thttpd_patch')
| -rw-r--r-- | sapi/thttpd/thttpd_patch | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/sapi/thttpd/thttpd_patch b/sapi/thttpd/thttpd_patch index 1a058c7aaa..4131e02673 100644 --- a/sapi/thttpd/thttpd_patch +++ b/sapi/thttpd/thttpd_patch @@ -203,4 +203,26 @@ diff -ur thttpd-2.21b-orig/thttpd.c thttpd-2.21b/thttpd.c hc->responselen = newlen; sz = 0; } -Only in thttpd-2.21b: thttpd.c~ +diff -ur thttpd-2.21b-plain/libhttpd.c thttpd-2.21b/libhttpd.c +--- thttpd-2.21b-plain/libhttpd.c Tue Apr 24 00:42:40 2001 ++++ thttpd-2.21b/libhttpd.c Mon Dec 10 14:32:26 2001 +@@ -3611,14 +3611,18 @@ + } + else + { ++ char *extraheads = ""; + hc->file_address = mmc_map( hc->expnfilename, &(hc->sb), nowP ); + if ( hc->file_address == (char*) 0 ) + { + httpd_send_err( hc, 500, err500title, "", err500form, hc->encodedurl ); + return -1; + } ++ if (strncmp(hc->decodedurl, "/nocache/", sizeof("/nocache/")-1) == 0) ++ extraheads = "Expires: Thu, 19 Nov 1981 08:52:00 GMT\r\nCache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0\r\nPragma: no-cache\r\n"; ++ + send_mime( +- hc, 200, ok200title, hc->encodings, "", hc->type, hc->sb.st_size, ++ hc, 200, ok200title, hc->encodings, extraheads, hc->type, hc->sb.st_size, + hc->sb.st_mtime ); + } + |
