httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Lewis <>
Subject Re: Filter function is called three times
Date Tue, 09 Oct 2007 13:21:31 GMT
Sven K├Ągi wrote:
> Hi all,
> I'm just trying to write my first Module (actually a filter) for Apache and
> made an observation I can't explain.


> I compiled the whole stuff, tested it with apache and it works fine. The only
> thing is: according to my logs my filter is called three times (twice with
> mode == AP_MODE_READBYTES and once with some other mode). The test page I call
> is a simple html-Page with no pictures or additional stuff. Actually it's a
> copy from the "It-Works!"-page.
> Finally my question: What could be the reason why my filter is called three
> times instead of once and is there something I could do about that?
> Thanks for any hint
> Sven
If the request is for a directory, you may see three separate requests,
each one ending in the DirectoryIndex options (e.g. /dir/index.html
/dir/index.htm, /dir/index.cgi, etc).  These are typically subrequests
that a single request generates if the request doesn't match a file

For fully understanding these, try logging the request URI.

It could also be related to a browsers ability to request just the
headers (via HEAD) or a full document (via GET) for caching.

I'd suggest logging a few of the request_rec fields just to be sure.

Joseph Lewis <>
"Divide the fire, and you will sooner put it out." - Publius Syrus

View raw message