We created a module to allow other modules to programmatically set cache exclusions from e.g. _update or_install hooks. This is useful when a module creates dynamic pages which should not be cached, especially for automated deployment environments.

It's currently at https://github.com/jcartledge/cacheexclude_api . It's very simple and we've been using it in production for some time.

It provides the folllowing functions:

cacheexclude_api_add($path)
cacheexclude_api_remove($path)
cacheexclude_api_get()
cacheexclude_api_save($cacheexclude_list)

I'd like to see it merged - perhaps as cacheexclude.api.inc.php or alternatively as a submodule. Is this something you'd be receptive to?

Comments

Crell’s picture

Version: 6.x-2.1 » 7.x-2.x-dev

Wow, I didn't notice this for a long time. :-)

I'm not entirely sure it's a good idea to have such an API, honestly. This module is far less necessary than it used to be, as there are more techniques to do randomization client-side and there are non-trivial performance implications to this module. Also, once Drupal 8 rolls around all bets are off about how this would even make sense.

Either way, new features would only be supported in the D7 version so bumping version. They should also be submitted as patches, not as github repos, so that they can be properly reviewed.