httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian J. France" <>
Subject mod_deflate and internal redirects
Date Fri, 31 Mar 2006 17:04:24 GMT
I was digging into why mod_deflate wasn't compressing some pages and  
found that any internal redirects (rewriterule) don't get compress.   
That is because of this code:

         /* only work on main request/no subrequests */
         if (!ap_is_initial_req(r)) {
             return ap_pass_brigade(f->next, bb);

The problem is ap_is_initial_req is:

   AP_DECLARE(int) ap_is_initial_req(request_rec *r)
       return (r->main == NULL)       /* otherwise, this is a sub- 
request */
              && (r->prev == NULL);   /* otherwise, this is an  
internal redirect */

r->main will be NULL, but r->prev is valid for internal redirects.   
This was talked about on IRC and Brian Akins mentioned creating a  
ap_is_subrequest call:

   #define ap_is_subrequest(r) (r->main != NULL)

and that mod_deflate could use it instead of the ap_is_initial_req  
call so it could compress internal redirects.



View raw message