Calls to taxonomy_get_tree() can get expensive on sites with large taxonomies. We can smartly cache the tree information required and avoid repeatedly calling it on every page view.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jrbeeman’s picture

Patch attached that caches the tree upon the first call to userpoints_get_categories(). The cache is stored indefinitely and only regenerated upon saving or deleting a term in the related taxonomy vocabulary.

jrbeeman’s picture

Assigned: jrbeeman » Unassigned
Status: Active » Needs review
jrbeeman’s picture

Missed the definition of the constant in that last patch. Please ignore patch #1.

The last submitted patch, 1: userpoints-cache_taxonomy_tree-2195893-1.patch, failed testing.

The last submitted patch, 1: userpoints-cache_taxonomy_tree-2195893-1.patch, failed testing.