Jean-Michel Hiver wrote:

>>You can subclass Apache::RegistryNG to do what you want and send the 
>>patch for others to re-use.
>>
> 
> The perldoc Apache::Registry says
> "Apache::Registry - Run unaltered CGI scrips under mod_perl"


Were your CGI scripts designed to handle HEAD requests? You don't have 
to alter them to run under mod_perl, do you?

 
> Thus I guess if I have to amend Apache::Registry it might be worth
> submitting a pach for a bugfix rather than a subclass of this module
> wouldn't it?


sure. but it may take a while before there will be a new release. So if 
you need it now subclassing is the best idea, and submitting the patch 
for inclusion in the core is for the future release.


>>The idea is interesting but while the implementation is possible it 
>>won't give any speed benefit. The positive effect that can be achieved 
>>is returning the caller exactly what it has asked for.
>>
> 
> I don't understand you here. It might not give any speed benefits in
> computing the headers, sure. But there are number of things that you
> might want to be in the headers (like date last modified, md5 checksum,
> content language, content length, etc) and they need the whole page to
> be computed anyway.


that's exactly what I meant. Once you get the whole body computed, you 
can just discard it if you don't want to send it over the net.


> You could argue that sending minimalistic headers to speed up head
> requests is possible, but then you're fucking proxies which are there to
> save you bandwidth and CPU anyway.


I thought that's the reason why you've asked this question and you are 
supposed to argue this point, not me :)


>>When I think more about it may be if PerlSendHeader is On, we can adjust 
>>the code that parses the script's output in search for headers, to 
>>return when it finds the 'Content-type' header.
> 
> Maybe there should be an option, like
> 
> ManageHeadRequests [On|Off]
> 
> The option might be 'Off' by default for backwards compatibility.
> 
> That would do the Right Thing whenever a HEAD request is invoked on the
> script. I'm quite surprised that this whole issue doesn't seem to have
> been raised yet - or maybe I missed something?


It's not clear what's the right thing for unaltered CGI scripts. Compute 
the body but send only headers? If the later is the Right Thing, I 
suppose that this can be done transparently at the Registry level 
without any new flags. That's why I've suggested that you subclass/patch 
it :)

_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/

Reply via email to