Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This project is not covered by Drupal’s security advisory policy.
This is a response to https://drupal.stackexchange.com/q/271802/57183
Problem:
How to invalidate/disable (internal) page cache from inside a twig template?
Answer:
Provide a Twig function that wraps a call to \Drupal::service(''page_cache_kill_switch'')->trigger();
Example:
From inside your Twig template simply call the function likes this:
{{ killswitchTrigger() }}
GitHub link:
https://github.com/stefanospetrakis/twig_killswitch_trigger
Project information
- Seeking new maintainer
The current maintainers are looking for new people to take ownership. - Created by stefanos.petrakis@gmail.com on , updated
- This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.