Conditional volt view cache

Hi my friends,

I want to start cache in view with some conditions (such as logged in user or not), but with no success!

1. {% if logged_in %}
2.   {% cache "my-page" %}
3. {% endif %}


Syntax error, unexpected token ENDIF in /var/www/testvolt/app/views/index/vip.volt on line 3

Is it possible to use conditional view cache anymore?


Thank you for your reply.

I already know how to cach view in controller but I think caching views in controller is not MVC-oriented.

I think the view layer should have such conditional enable/disable cach functionality


Hi guys,

I think that you would use and