Cache check none and twig templates

Hi guys,

According to the Grav Documentation here:

If automatic re-caching of changed pages it not critical to you, then setting this value (i.e. cache check) to none will speed a production environment up even more. You will just need to manually clear the cache after changes are made.

In my case, I have a twig snippet to pick a random item from a translated array like is described here and, for now, using cache: check: none, I need to manually clear the cache to refresh it.

I was wondering if there exists a way to keep using cache: check: none on a production environment and instructs Twig to don’t cache certain parts of a template. It’s possible or, maybe I am missing something?

Thank you very much for your time and help.

My user/config/system.yaml:

— yaml
enabled: true
method: none
driver: auto
prefix: 'g’
gzip: true

cache: true
debug: false
auto_reload: true

You can disable Twig caching in the page header, or globally. See Never Cache Twig. Not aware of a way to do this in the Twig file directly.

Great! Thank you very much Flavio.