1 filter.module _filter_format_is_cacheable($format)

Helper function to determine whether the output of a given text format can be cached.

The output of a given text format can be cached when all enabled filters in the text format allow caching.


$format: The text format object to check.

Return value

TRUE if all the filters enabled in the given text format allow caching,: FALSE otherwise.

See also



core/modules/filter/filter.module, line 1110
Framework for handling the filtering of content.


function _filter_format_is_cacheable($format) {
  if (empty($format->filters)) {
    return TRUE;
  $filter_info = filter_get_filters();
  foreach ($format->filters as $name => $filter) {
    // By default, 'cache' is TRUE for all filters unless specified otherwise.
    if (!empty($filter->status) && isset($filter_info[$name]['cache']) && !$filter_info[$name]['cache']) {
      return FALSE;
  return TRUE;