Our site has an awful lot of roles for authenticated users, but 90% of them are irrelevant in terms of cache keys. I have crafted a small patch to the ESI module that allows the set of roles that are incorporated into the hash to be configurable in the settings. The default is still to include all roles.

For more advanced cases, I've also added drupal_alter() hooks into the role and user hashing functions for other modules to do fancier decisions on which roles matter.

Hope you like it! Wonderful module by the way...

Members fund testing for the Drupal project. Drupal Association Learn more


mikeytown2’s picture

Status: Needs review » Fixed
2.92 KB

Thanks. This patch has been committed. I've just added more documentation to your patch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

manarth’s picture

7.x-3.x contains an alternative implementation: you can use hook_esi_context() to introduce a new limited-role context, or hook_esi_context_alter() to change the role context and remove the irrelevant roles.