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.
Port to Drupal 8 - attached the patch. Also I would like to be co-maintainer of this module.
Comment | File | Size | Author |
---|---|---|---|
cacheexclude-d8port.patch | 9.31 KB | jeqq |
Comments
Comment #1
andypostA bit outdated according https://www.drupal.org/node/2323571
should be injected
Is gone should be implemented on top of
page_cache_response_policy
needs
getEditableConfigNames()
Comment #2
yang_yi_cn CreditAttribution: yang_yi_cn commentedI tried many ways and neither drupal_page_is_cacheable nor page_cache_response_policy seem to work at all.
In the end I used this method: https://pantheon.io/docs/cache-control/
By definiing a custom block with
$build['#cache']['max-age'] = 0;
and name it "non cacheable block", place the block on any page you don't want to cache and that page will not be cached.I believe the block settings should have covered most of the use cases like by page, by content type, by language, by user role etc.
You need to completely rewrite this module that way though.
Comment #3
agentrickardI've given https://www.drupal.org/u/gobinathm maintainer access at his request, to try to jumpstart this issue.
Comment #4
yang_yi_cn CreditAttribution: yang_yi_cn commentedhmm... recently I learned there's a thing called cache killswitch in D8:
https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21PageCache...
If block #cache setting doesn't work, it looks like we can try to use this KillSwitch instead. It seems to be working and taking effect in pretty early stage.
Comment #5
naiduharish CreditAttribution: naiduharish as a volunteer commentedI have released D8 dev version for this module. Please follow https://www.drupal.org/node/2868317