diff Lib/IMPL/Web/TT/Document.pm @ 134:44977efed303

Significant performance optimizations Fixed recursion problems due converting objects to JSON Added cache support for the templates Added discovery feature for the web methods
author wizard
date Mon, 21 Jun 2010 02:39:53 +0400
parents 0dce0470a3d8
children 5b849974bed8
line wrap: on
line diff
--- a/Lib/IMPL/Web/TT/Document.pm	Fri Jun 18 16:27:28 2010 +0400
+++ b/Lib/IMPL/Web/TT/Document.pm	Mon Jun 21 02:39:53 2010 +0400
@@ -15,6 +15,7 @@
 BEGIN {
     private property _provider => prop_all;
     private property _context => prop_all;
+    public property cache => prop_all;
     public property template => prop_get | owner_set;
     public property presenter => prop_all, { validate => \&_validatePresenter };
     private property _controlClassMap => prop_all;
@@ -25,12 +26,13 @@
 );
 
 sub CTOR {
-	my ($this) = @_;
+	my ($this,%args) = @_;
 	
 	$this->_controlClassMap({});
 	$this->registerControlClass( Control => 'IMPL::Web::TT::Control' );
 	$this->appendChild( $this->Create(body => 'IMPL::Web::TT::Collection') );
 	$this->appendChild( $this->Create(head => 'IMPL::Web::TT::Collection') );
+	$this->cache($args{cache}) if $args{cache};
 }
 
 sub CreateControl {
@@ -171,6 +173,8 @@
         INTERPOLATE => 1,
         PRE_CHOMP => 1,
         POST_CHOMP => 1,
+        COMPILE_EXT => $this->cache ? '.ttc' : undef,
+        COMPILE_DIR => $this->cache,
         INCLUDE_PATH => [$inc,@includes]
     );