>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 (Apache HTTP Project)
>State:          open
>Class:          change-request
>Submitter-Id:   apache
>Arrival-Date:   Sat May 31 23:50:01 1997
>Originator:     [EMAIL PROTECTED]
>Organization:
apache
>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:
>Unformatted:


Reply via email to