Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
subform.module contains the following comments:
// TODO prevent caching in drupal_rebuild_form() as we are doing it later
// in subform_parent_after_build().
My site is suffering from bad performance because it executes many cache_set calls while rebuilding.
Will the following code prevent caching the right way?
$nocache = !empty($subform_state['no_cache']);
$subform_state['no_cache'] = TRUE;
$element['#subform'] = drupal_rebuild_form($element['#subform_id'], $subform_state, $old_subform);
$subform_state['no_cache'] = $nocache;
Comment | File | Size | Author |
---|---|---|---|
#1 | subform-nocache-2370143-1.patch | 725 bytes | Jorrit |
Comments
Comment #1
Jorrit CreditAttribution: Jorrit commented