Hello, I believe that the code is in the file to make sure that Components ect. are run even if the page is cached (Might be useful for auth amongst many things).
https://trac.cakephp.org/ticket/4245 and https://trac.cakephp.org/ticket/2329 discusses this issue already. I have made a modified CacheHelper (1.2x) that does not add the php in the top if there is no cake:nocache blocks. http://cakephp.dk/app/webroot/patches/cache.phps -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Claudia Sent: 4. marts 2008 18:09 To: Cake PHP Subject: view caching problem Hi there I have a question regarding view caching: I have a controller foo where I want to cache the result of action bar. Therefore I put a line $this->cacheAction = 3600; in the action. The cache file is created fine, but when I fetch a page from the cache it takes almost as much time as without caching, about 0.2 seconds. I have confirmed that the file comes from the cache. When I check the cache file I see that there is a lot of php in there, starting with loadController('foo'); loadModels(); $this->controller = new fooController(); $this->controller->plugin = ''; $this->controller->_initComponents(); ... which needs a lot of time to execute. The php is then followed by the html output of the view. If I delete the php part of the cache file manually and reload the webpage, the page is pretty fast (about 0.02 seconds) and everything works fine until the cache file is recreated. Thus my question(s): What is the purpose the PHP part of the cache file? In case the PHP part is not really necessary, is there a way to tell Cake to cache only the output of the view, without adding the PHP stuff? I use Cake 1.2.0.5427alpha Thank you Claudia --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
