httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralf Mattes ...@seid-online.de>
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 <rm@seid-online.de> 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: http://www.freesoft.org/CIE/Topics/102.htm
This is really the most basic description of HTTP. Then:
http://en.wikipedia.org/wiki/HyperText_Transfer_Protocol
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
http://en.wikipedia.org/wiki/HTTP_pipelining)
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.

HTH RalfD
 
> Sam


Mime
View raw message