explain why form caching isnt effective

This commit is contained in:
Nathan Coad
2017-11-25 20:35:31 +11:00
parent 6ff5ae7790
commit 0395b406a5

View File

@@ -950,13 +950,18 @@ function booking_form($node, &$form_state, $inserting = FALSE, $early_access_all
'#default_value' => !empty($data->booking_freestyle_text) ? $data->booking_freestyle_text : '' '#default_value' => !empty($data->booking_freestyle_text) ? $data->booking_freestyle_text : ''
); );
} }
// https://www.lullabot.com/articles/a-beginners-guide-to-caching-data-in-drupal-7
// This code will only cache this one element
// And forms get cached differently anyway
/*
$form['cache'] = array('#cache' => array( $form['cache'] = array('#cache' => array(
'cid' => 'booking_data', 'cid' => 'booking_data',
'bin' => 'cache_booking', 'bin' => 'cache_booking',
'expire' => time() + 360, 'expire' => time() + 360,
), ),
); );
*/
if ($inserting == TRUE) { if ($inserting == TRUE) {
$form['submit'] = array( $form['submit'] = array(