Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ability to never cache twig. #1244

Merged
merged 1 commit into from
Jan 12, 2017
Merged

Conversation

rhukster
Copy link
Member

@rhukster rhukster commented Jan 12, 2017

This makes it possible to cache content, but always process twig. Useful for regular but especially modular pages.

never_cache_twig: true

Enabling this will allow you to add a processing logic that can change dynamically on each page load, rather than caching the results and storing it for each page load.

This can be enabled/disabled site-wide in the system.yaml, or on a specific page.

This allows twig logic to be processed on every page load even if the page is a modular subpage. This is similar to disabling the cache completely, however, cache is still used to store the regular content that has been processed by markdown, plugins, etc. So performance is better than disabling the cache, but not as good as caching content+twig processing.

NOTE: This is not compatible with twig_first: true currently because all processing is happening in the one Twig call.

It might be possible to refactor the twig processing to handle page processing and modular processing independently. I can look at this later.

Please test!

…ntent, but always process twig. Useful for regular but especially modular pages.
Copy link
Contributor

@flaviocopes flaviocopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested

@rhukster rhukster merged commit 759ba51 into develop Jan 12, 2017
@rhukster rhukster deleted the feature/never_cache_twig branch January 12, 2017 18:52
mahagr added a commit that referenced this pull request Oct 12, 2017
mahagr added a commit that referenced this pull request Oct 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants