perl-asp mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Chamas <>
Subject Re: Response->Include
Date Mon, 24 Feb 2003 00:10:32 GMT
Csongor Fagyal wrote:
> Hi,
> If I understand correctly, <!--#include file="aspfile" 
> args=@args-->compiles aspfile only once, and consequtive calls only pass 
> @args to the precompiled script. I guess the same is done when I use 
> $Response->Include($filename, @args). But what happens if I use 

Yes, it actually compiles to $Response->Include() on the backend.

> $Response->Include(\$script_text, @args)? Is $srcipt_text recomplied 
> every time I call it? If yes, can this behaviour be changed? Or, is 

Yes, the script is recompiled each time.  The reason is that since
the text is not being loaded from a static file, it is assumed to
be dynamically generated.  If Apache::ASP were to cache compilations
of dynamically generated code, this would be a large memory leak
each time the script were to be called.

> there a way - maybe that is rather a mod_perl question - to compile perl 
> scripts (modulest, etc.) in runtime and keep them compiled in memory and 
> shared between Apache childs?

Sure, one way to cache dynamic code compilations that have no name
would be to simply keep the subroutine reference that it is compiled
to looked up by something like an MD5 checksum of the code itself.

Something that could make things better would be a parse cache
to cache the compilation of the ASP script to perl code, but still
leave the perl code to perl eval of generated subroutine not cached.
I have thought about adding a parse cache before, but I haven't
heard of people needing this yet, perhaps because of using things
like Apache::ASP->Loader() is good enough to cache compilations,
or maybe Apache::ASP parsing is generally fast enough.



Josh Chamas, Founder                   phone:925-552-0128
Chamas Enterprises Inc.      
NodeWorks Link Checking      

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message