It's a easy way to clear or remove cache with using this simple code.
Code: \Drupal::service('page_cache_kill_switch')->trigger();
Description: Simple write this code on your function and when your code will hit or run on any page this page cache will automatically triggered and clear.
Note: If have any suggestions or issue regarding 'How to dynamically clear cache in drupal 8?' then you can ask by comments.
Code: \Drupal::service('page_cache_kill_switch')->trigger();
Description: Simple write this code on your function and when your code will hit or run on any page this page cache will automatically triggered and clear.
Note: If have any suggestions or issue regarding 'How to dynamically clear cache in drupal 8?' then you can ask by comments.
No comments:
Post a Comment