|
From: <pan...@us...> - 2009-03-02 19:21:09
|
Revision: 519
http://acmcontester.svn.sourceforge.net/acmcontester/?rev=519&view=rev
Author: panzaboi
Date: 2009-03-02 19:21:05 +0000 (Mon, 02 Mar 2009)
Log Message:
-----------
speed increase
Modified Paths:
--------------
website/library/Application.php
Modified: website/library/Application.php
===================================================================
--- website/library/Application.php 2009-03-02 18:45:44 UTC (rev 518)
+++ website/library/Application.php 2009-03-02 19:21:05 UTC (rev 519)
@@ -72,6 +72,9 @@
//Zend_Loader::registerAutoload();
spl_autoload_register(array('Application', 'autoload'));
+ // Use Cache
+ $this->_usePageCache();
+
// Setup Session
Zend_Session::start();
@@ -292,6 +295,32 @@
Zend_Registry::set('Zend_Log', $log);
}
+
+ protected function _usePageCache()
+ {
+ $frontendOptions = array(
+ 'lifetime' => 3600,
+ 'default_options' => array(
+ // disable default caching for all requests
+ 'cache' => true
+ ),
+
+ // cache routes to Index and News controllers
+ /*'regexps' => array(
+ '^/$' => array('cache' => true),
+ '^/news/' => array('cache' => true)
+ )*/
+ );
+
+ $cache = Zend_Cache::factory(
+ 'Page',
+ 'Apc',
+ $frontendOptions
+ );
+
+ // serve cached page (if it exists) and exit
+ $cache->start();
+ }
};
/*function br2nl($text)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|