How do I use Zend Cache on this particular problem

Posted by davykiash on Stack Overflow See other posts from Stack Overflow or by davykiash
Published on 2010-05-30T16:20:51Z Indexed on 2010/05/30 16:22 UTC
Read the original article Hit count: 348

Filed under:
|
|

I have an action that renders two different view scripts based on whether the user is logged in or not.

class IndexController extends Zend_Controller_Action
{
    ....
        public function indexAction()
            {

                $auth = Zend_Auth::getInstance();
                if($auth->hasIdentity())
                {
                    $this->render('indexregistered');
                    return; 
                }
                else {
                    $this->render('indexpublic');
                    return;
            }   
    }   
    ....    
} 

I have seen quite some useful examples on how to use the Zend Cache and they seem to be based on the fact that the action renders one particular script.

What am really looking at is the best approach to cache the the indexpublic script does get quite some hits and I would live to avoid the Zend MVC overhead if possible.

© Stack Overflow or respective owner

Related posts about php

Related posts about cache