You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Rasoul Hajikhani <ra...@rhythm.com> on 2002/03/06 21:28:24 UTC

Document Caching

Hello People,
Need your advise on how to cache a template under mod_perl... Any ideas?
Thanks in advance
-r

Re: Document Caching

Posted by Adekunle Olonoh <ol...@yahoo.com>.
> > >Need your advise on how to cache a template under mod_perl... Any ideas?
> > >Thanks in advance
> > 
> Thanks... But I use Template Toolkit to generate a dynamic file. How
> would the above code work in that situation?!

You should probably post this to the Template Toolkit mailing list for
more info but TT has built-in support for caching templates to disk.

TT mailing list: http://www.template-toolkit.org/info.html#lists
TT caching:
http://www.template-toolkit.org/docs/plain/Manual/Config.html#Caching_and_Compiling_Options


--Ade.


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


Re: Document Caching

Posted by "Rafiq Ismail (ADMIN)" <ra...@joshua.dreamthought.com>.
On Wed, 6 Mar 2002, Rasoul Hajikhani wrote:
> Robert Landrum wrote:
> > #startup.pl
> >
> > open(FILE,"</path/to/tmpl");
> > $MY::TEMPLATE .= while(<FILE>);
> > close(FILE);
> Thanks... But I use Template Toolkit to generate a dynamic file. How
> would the above code work in that situation?!
Not how I'd do it, although I'm pretty sure that TT2 has it's own caching
mechanism, however in answer to this 'particular question' could you not
overload TT's service object to use the preloaded instantiation similar,
or more specialised than the one above. (SEE ALSO man Template::Service
..probably) :)

fiq


btw Apache::Template does let you control caching of templates in memory.


Re: Document Caching

Posted by Rasoul Hajikhani <ra...@rhythm.com>.
Robert Landrum wrote:
> 
> At 12:28 PM -0800 3/6/02, Rasoul Hajikhani wrote:
> >Hello People,
> >Need your advise on how to cache a template under mod_perl... Any ideas?
> >Thanks in advance
> >-r
> 
> #startup.pl
> 
> open(FILE,"</path/to/tmpl");
> $MY::TEMPLATE .= while(<FILE>);
> close(FILE);
> 
> Provided that you never change $MY::TEMPLATE, this should work fine.
> 
> --
> When I used a Mac, they laughed because I had no command prompt. When
> I used Linux, they laughed because I had no GUI.
Thanks... But I use Template Toolkit to generate a dynamic file. How
would the above code work in that situation?!
-r

Re: Document Caching

Posted by Robert Landrum <rl...@capitoladvantage.com>.
At 12:28 PM -0800 3/6/02, Rasoul Hajikhani wrote:
>Hello People,
>Need your advise on how to cache a template under mod_perl... Any ideas?
>Thanks in advance
>-r


#startup.pl

open(FILE,"</path/to/tmpl");
$MY::TEMPLATE .= while(<FILE>);
close(FILE);


Provided that you never change $MY::TEMPLATE, this should work fine.


--
When I used a Mac, they laughed because I had no command prompt. When 
I used Linux, they laughed because I had no GUI.