On Fri, 4 Feb 2000, Simon Rosenthal wrote:

> At 07:55 PM 2/4/00 +0200, Stas Bekman wrote:
> > > At 06:17 PM 2/4/00 +0200, Stas Bekman wrote:
> > > >The next module is Apache::RegistryNG.
> > > >
> > > >C<Apache::RegistryNG> is the same as C<Apache::Registry>, aside from
> > > >using filename instead of URI for the namespace. It also uses OO
> > > >interface.
> > > >
> > > >   <snip>
> > >
> > > >There is no compelling reason to use C<Apache::RegistryNG> over
> > > >C<Apache::Registry>, unless you want to do add or change the
> > > >functionality of the existing I<Registry.pm>.  For example,
> > > >C<Apache::RegistryBB> (Bare-Bones) is another subclass that skips the
> > > >stat() call performed by C<Apache::Registry> on each request.
> > >
> > >
> > > >One situation where Apache::RegistryNG  may definitely be required  is if
> > > >you are rewriting URLS  (using either mod_rewrite or your own 
> > handler)  in
> > > >certain ways.
> > >
> > > For instance  if you  have a rewrite rule  of the form XYZ123456.html  ==>
> > > /perl/foo.pl?p1=XYZ&p2=123456
> > > Apache::Registry loses big, as it recompiles foo.pl  for each unique
> > > URL.  We ran into this and were totally baffled  as to why we had no
> > > mod_perl performance boost  until Doug pointed us to RegistryNG, which is
> > > definitely your friend in these circumstances.
> >
> >Huh? Why would Apache::Registry recompile /perl/foo.pl ?
> >
> >p1=XYZ&p2=123456 is a query string and it doesn't affect the created
> >script's package name.  Do I miss something?
> 
> Yup, or I wasn't clear enough . The point was that we had a whole class of 
> URLS that would yield different package names for Registry, even though 
> they were all being processed by the same file.
> 
> Add to my example above  another rewrite:  ABC999999.html => 
> /perl/foo.pl?p1=ABC&p2=999999...
> (and another, and another...)
>   They all yield different package names  based on the original URL (at 
> least if you use mod_rewrite), so Registry has no way of knowing that they 
> are all processed by the same script. RegistryNG doesn't have this problem, 
> since  the package name is based on $r->filename, which is the same for all 
> of them.

Ok, just so I could show a complete example for the guide, the rule:

  XYZ123456.html => /perl/foo.pl?p1=XYZ&p2=123456

generates the package Apache::root::...::XYZ123456_2ehtml ? This explains
my confusion.

_______________________________________________________________________
Stas Bekman    mailto:[EMAIL PROTECTED]      http://www.stason.org/stas
Perl,CGI,Apache,Linux,Web,Java,PC     http://www.stason.org/stas/TULARC
perl.apache.org    modperl.sourcegarden.org   perlmonth.com    perl.org
single o-> + single o-+ = singlesheaven    http://www.singlesheaven.com

Reply via email to