Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

compileAlways Not Working for Me

This is the function I'm using.

$di->set('view', function() {
    $view = new Phalcon\Mvc\View();
    $view->setViewsDir('../app/views/');
    $view->registerEngines(array(
        ".phtml" => function($view, $di) {
            $volt = new Phalcon\Mvc\View\Engine\Volt($view, $di);
            $volt->setOptions(array(
                'compiledPath' => '../app/cache/',
                'compiledExtension' => '.compiled',
                'compileAlways' => true,
                'stat' => true
            )); #options
            return $volt;
    })); #register
    return $view;
}); #view

Any ideas why I still see cached files in /app/cache/ ? It's very anoying having to delete this files manually when developing.

Thank You!



82.2k
Accepted
answer

Files are generated at every request but they're re-generated again and again if compileAlways is true



8.8k

@Phalcon, oh I see. Is there a way to disable creation of those files ? It would be nice to have some option that allows you completely disable the cache. Thanks.

I think it's not possible to deactivate the cache because volt/phtml templates must be translated into php to get rendered on the server.