We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Cache only \Phalcon\Mvc\View::LEVEL_ACTION_VIEW level

Hello, I would like to cache action lavele view of my page. In my controller I tried the following code :

    $exists = $this->view->getCache()->exists($cache_key);
    if (!$exists) {
    }
    $this->view->cache(array("lifetime" => 3600, "key" => $cache_key, "level" => \Phalcon\Mvc\View::LEVEL_ACTION_VIEW));

But still the entire page is cached completely with all layouts. I'm on Phalcon 2.0.10 Any Help appreciated !



3.4k

thx, but that method only work with output data and doesn't store the view of current action....

Check this - https://github.com/phalcon/cphalcon/issues/2377