List Info

Thread: mod_deflate and internal redirects




mod_deflate and internal redirects
user name
2006-03-31 17:04:24
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)) {
             ap_remove_output_filter(f);
             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.

Thoughts?

Brian

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )