From nobody@hyperreal.com Sat May 31 23:42:14 1997 Received: (from nobody@localhost) by hyperreal.com (8.8.5/8.8.5) id XAA18106; Sat, 31 May 1997 23:42:14 -0700 (PDT) Message-Id: <199706010642.XAA18106@hyperreal.com> Date: Sat, 31 May 1997 23:42:14 -0700 (PDT) From: Jason Riedy Reply-To: ejr@cise.ufl.edu To: apbugs@hyperreal.com Subject: Adding a little cachability to HTTP/<=1.0 type-map responses... X-Send-Pr-Version: 3.2 >Number: 649 >Category: mod_negotiation >Synopsis: Adding a little cachability to HTTP/<=1.0 type-map responses... >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache >State: closed >Class: change-request >Submitter-Id: apache >Arrival-Date: Sat May 31 23:50:01 1997 >Last-Modified: Sun Aug 24 11:20:24 PDT 1997 >Originator: ejr@cise.ufl.edu >Organization: >Release: 1.2b11 >Environment: SunOS iguana 5.5 Generic sun4m sparc SUNW,SPARCstation-10 >Description: If type maps are set to issue a redirect instead of performing an internal redirect, proxies should be able to cache the result. This doesn't really make sense for MultiViews because of the extra extension, but type maps deal with normal URIs. I added a ``RedirectPre1.1TypeMappedDocs'' option (ugly lookin', but I couldn't think of a better name) and twiddled the machinery in handle_map_file. If the rcsdiff patch doesn't translate for some reason, it's also at http://www.cise.ufl.edu/~ejr/mod_negotiation.c.patch. Yeah, this is kinda silly, but who knows how long it'll be before other browsers use HTTP/1.1... >How-To-Repeat: >Fix: 138c138,140 < return (get_module_config (s->module_config, &negotiation_module) != NULL); --- > return (strncmp (get_module_config (s->module_config, > &negotiation_module), > "Cache", 5) == 0); 140a143,158 > const char *redirect_typemapped_docs (cmd_parms *cmd, void *dummy, > char *dummy2) > { > void *server_conf = cmd->server->module_config; > > set_module_config (server_conf, &negotiation_module, "Redir"); > return NULL; > } > > int do_redir_typemapped_docs (server_rec *s) > { > return (strncmp (get_module_config (s->module_config, > &negotiation_module), > "Redir", 5) == 0); > } > 145a164,165 > { "RedirectPre1.1TypeMappedDocs", redirect_typemapped_docs, NULL, > RSRC_CONF, RAW_ARGS, NULL }, 1850c1870 < --- > 1882a1903,1904 > res = OK; > 1887,1888c1909,1917 < if (!do_cache_negotiated_docs(r->server) && (r->proto_num < 1001)) < r->no_cache = 1; --- > if (r->proto_num < 1001) { > /* If the mapping is through redirection, the result is > * cachable. > */ > if (do_redir_typemapped_docs(r->server)) > res = HTTP_MOVED_TEMPORARILY; > else if (!do_cache_negotiated_docs(r->server)) > r->no_cache = 1; > } 1898,1900c1927,1935 < internal_redirect(pstrcat(r->pool, udir, best->file_name, r->path_info, < NULL), r); < return OK; --- > if (OK == res) > internal_redirect(pstrcat(r->pool, udir, best->file_name, > r->path_info, NULL), r); > else > table_set (r->headers_out, "Location", > pstrcat(r->pool, udir, best->file_name, r->path_info, > NULL)); > > return res; %0 >Audit-Trail: State-Changed-From-To: open-feedback State-Changed-By: pcs State-Changed-When: Sat Aug 23 08:19:01 PDT 1997 State-Changed-Why: Cacheing the result of negotiated resources is usually not a good idea because proxies or browsers will cache one variant when others might be better for subsequent requests. If you really want to make the response cacheable you can use the CacheNegotiatedDocs, which also only applies to HTTP/1.0 and earlier requests. Why do you want to issue redirects instead of making the response itself cacheable? Unless there is a good reason for this, we will prefer not to implement your RedirectPre1.1TypeMappedDocs directive. Incidently, the only time when it is safe to cache the response of negotiation is when multiviews is being used and there is a single variant with a matching filename (for example, to map requests for /index to /index.html). Apache 1.3 will mark the results of such negotiation as cacheable. Comment-Added-By: pcs Comment-Added-When: Sun Aug 24 04:06:34 PDT 1997 Comment-Added: PR closed From: Paul Sutton To: apbugs@apache.org Subject: Re: mod_negotiation/649: Adding a little cachability to HTTP/<=1.0 type-map responses... (fwd) Date: Sun, 24 Aug 1997 12:05:48 +0100 (BST) Date: Sat, 23 Aug 1997 12:27:52 -0400 From: Jason Riedy To: pcs@hyperreal.org Cc: apache-bugdb@apache.org Subject: Re: mod_negotiation/649: Adding a little cachability to HTTP/<=1.0 type-map responses... Oh well. And pcs@hyperreal.org writes: - Unless there is a good reason for this, we will - prefer not to implement your RedirectPre1.1TypeMappedDocs - directive. It's ok... I _know_ I had a reason for it, but I can't remember it now. The better fix is probably to add the valid request headers into the proxy's hash, anyways. Jason State-Changed-From-To: feedback-closed State-Changed-By: marc State-Changed-When: Sun Aug 24 11:20:22 PDT 1997 State-Changed-Why: I assume that when Paul said "PR closed" he meant to close it. >Unformatted: