Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Cache check none and twig templates

Started by Muut Archive 9 years ago · 2 replies · 827 views
9 years ago

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
cache:
enabled: true
check:
method: none
driver: auto
prefix: 'g'
gzip: true

twig:
cache: true
debug: false
auto_reload: true

9 years ago

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.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1336 9 years ago
Archive · by Muut Archive, 9 years ago
2 926 9 years ago
Archive · by Muut Archive, 9 years ago
2 4056 9 years ago
Archive · by Muut Archive, 9 years ago
1 2941 9 years ago
Archive · by Muut Archive, 9 years ago
3 1112 9 years ago