httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralf Mattes>
Subject Re: apache module or CGI
Date Mon, 26 Mar 2007 21:37:14 GMT
On Mon, 2007-03-26 at 13:04 -0400, Sam Carleton wrote:
> On 3/26/07, Ralf Mattes <> wrote:
> > And there _are_ response status that indicate a lengthy content
> > generation ...
> Can you expand on this a bit more, what are the response status?  I
> have no problem looking them up to learn about them, I just need to
> know what to look up;)

Oh, how about:
This is really the most basic description of HTTP. Then:
Which has a section 'Status codes'. If you want/need on-the-fly
generation of images  you might also be interested in 'Persistent
connections' (and _do_ follow the link to
The link section on the bottom of the page links to serveral tutorials.
> > Since the OP seems to feel comfortable in  C/C++ I'd write a custom
> > handler module that generates the scaled image on the fly and saves it
> > into a cache.
> Ralf,
> You are correct, I am very much at home in C/C++.  Other then C#,
> other languages are much less comfortable for me;)  It looks like
> there is a lot of infrastructure code that is needed when implementing
> an apache handler module and a whole new "framework" to learn.  Is the
> work worth it compared to CGI (maybe FastCGI) for what I am doing?
> That is the million dollar question I am seeking;)

Depends on what you want to do. For a simple content handler (i.e. a
module that _produces_ content (rather than modifies content)) the
framework is actually rather lean. A simple:

 apxs -g -n fancy_image_handler

will generate a sample module where you only need to fill in the actual
content generation code. NOTE: iff this needs to be portable you _will_
need to dive into the APR documentation (APR is a framework/library that
abstracts over OS dependend functionality - much easier than writing
custom file system code for every supported OS).
Is it worth the effort? Hard to tell - for a moderately busy system a
trivial CGI program (i _hate_ to call'em scripts) will probably do. On a
high volume site external processes start to become expensive (both in
terms of process count as well as file descriptor usage. There _are_
limits for both ...). And as soon as you need locking (don't want to
serve a _partially_ generated image, do you?) modules might be even
simpler than CGIs.

> Sam

View raw message