Currently, if a filter allows for dynamic data, it must specify 'no cache' to true in order to prevent its data from becoming stale. While this is fine for fairly lightweight filter chains, combining dynamic data with some heavy static crunching becomes impossible with this setup. For example:

1. Expensive Static Filter
2. Cheap Dynamic Filter

After step 2, we cannot cache, as the dynamic filter will cause problems.

However, if we inserted the cache in-between these two filters:

1. Expensive Static Filter
2. Cache
3. Cheap Dynamic Filter

We would reap the benefits of both worlds.

Thus, we add a 'post process' $op for hook_filter() which is always run, either on freshly generated text or text retrieved from the database. Patch is attached.

Comments? Naming problems? Should be another hook function? This won't get into 6.x, maybe for 7.x it would be nice. Patch attached.

CommentFileSizeAuthor
post-process-filter.patch2.73 KBezyang
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sun’s picture

Version: 6.x-dev » 8.x-dev
Wim Leers’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)

As of #2217877: Text filters should be able to add #attached, #post_render_cache, and cache tags, this is now possible. See https://drupal.org/node/2278483 for a high-level explanation, see the issue for details.