Index: lib/eztemplate/classes/eztemplatecompiler.php
===================================================================
--- lib/eztemplate/classes/eztemplatecompiler.php	(revision 24228)
+++ lib/eztemplate/classes/eztemplatecompiler.php	(working copy)
@@ -437,6 +437,19 @@
                                        $tpl, $key, &$resourceData,
                                        $rootNamespace, $currentNamespace )
     {
+        $ini = eZINI::instance();
+        if ( $ini->variable( 'TemplateSettings', 'CompileCacheInMemory' ) == 'enabled' )
+        {
+            static $script_map = array();
+            if ( !array_key_exists( $phpScript, $script_map ) )
+            {
+                $raw_script = file_get_contents( $phpScript );
+                $raw_script = str_replace( '<?php', '', $raw_script );
+                $raw_script = str_replace( '?>', '', $raw_script );
+                $script_map[$phpScript] = $raw_script;
+            }
+        }
+
         $vars =& $tpl->Variables;
 
         /* We use $setArray to detect if execution failed, and not $text,
@@ -446,7 +459,10 @@
         $namespaceStack = array();
 
         $tpl->createLocalVariablesList();
-        include( eZTemplateCompiler::TemplatePrefix() . $phpScript );
+        if ( $ini->variable( 'TemplateSettings', 'CompileCacheInMemory' ) == 'enabled' )
+            eval( $script_map[$phpScript] );
+        else
+            include( eZTemplateCompiler::TemplatePrefix() . $phpScript );
         $tpl->unsetLocalVariables();
         $tpl->destroyLocalVariablesList();
 
Index: settings/site.ini
===================================================================
--- settings/site.ini	(revision 24228)
+++ settings/site.ini	(working copy)
@@ -880,6 +880,9 @@
 # Controls whether compiled templates should be stored gzip compressed on disk.
 # This drastically reduces disk usage.
 TemplateCompression=disabled
+# If enabled, compiled templates will be loaded from memory instead of disk
+# This can speed up eZ Publish on slow filesystems (e.g. Solaris)
+CompileCacheInMemory=enabled
 # Controls if development is enabled or not.
 # When enabled the system will perform more checks like modification time on
 # compiled vs source file and will reduce need for clearing template compiled
