So as it seems now token flushing in case of problems becomes commonly accepted practice, would be nice to have per-token cache so if module wanted to clear only some tokens, entire cache wouldn't be lost. It seems now too many modules may clear entire token cache, rendering it useless in many cases.

Comments

crea’s picture

Anyone ? We are now using very inefficient practice of flushing entire cache. For example of inefficiency see #529186: Usage of global token breaks default page titles because of early Token caching

Cyberwolf’s picture

Subscribing.

jeeba’s picture

Suscribing too, problems with the pagin and tokens in www.amarilysfloreria.com

EvanDonovan’s picture

Subscribing.

pacufist’s picture

It seems still not solved in "6.x-1.18".

In function token_get_values() :

<?php
  // Flush the static token cache. Useful for processes that need to slog
  // through huge numbers of tokens in a single execution cycle. Flushing it
  // will keep them from burning through memory.
  if ($flush || !empty($options['reset'])) {
    $tokens = array();
  }
?>

Why not this way ?:

<?php
  if ($flush || !empty($options['reset'])) {
    $tokens[$type] = array();
  }
?>

For example, now page_title_page_get_title() clears all 'node' tokens. But need only 'global' :(