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

Caching partials

Hello,

Is it possible to cache only partials in a view ?

How does work the "level" option of the cache method of the view, it's not really clear.

Thanks in advance



741
Accepted
answer

php{# cache the partial by 1 hour #} {% cache "partial" 3600 %} {{ partial('partial_name') }} {% endcache %}

I think you could do something like this. That is from the docs https://docs.phalcon.io/en/latest/reference/volt.html



8.6k

How can I cache a partial if I don't use volt, but phtml templates?



2.0k

Up the question.... Is it possible?