How about if we save a lot of time recreating a report that hasn't changed:

function configdoc_page($form_state) {
  $report = cache_get('configdoc_report');
  if ($configdoc_output = cache_get('configdoc_report')) {
    $configdoc_output = $report->data;    
  }
  else {
    $configdoc_output = configdoc_create();
    cache_set('configdoc_report', $configdoc_output);
  }
  $form = array();

  //$form['#action'] = base_path().'admin/reports/configdoc/save';
  $form['body'] = array(
    '#type' => 'textarea',
    '#title' => t('Report'),
    '#default_value' => $configdoc_output,
    '#rows' => 30,
//    '#cols' => 80,
    '#description' => t('If you are copying and pasting this into another site, you may wish to include a preformatted tag (<pre></pre>).'),
    );

Since module admin (amongst many others) will clear the cache, this will not be a problem.

On my test site, this saved better than 30 seconds per refresh.

Also note the description change, which I discovered posting the output to DO.

CommentFileSizeAuthor
#1 configdoc_05.patch5.01 KBnancydru

Comments

nancydru’s picture

Assigned: Unassigned » nancydru
Status: Patch (to be ported) » Needs review
StatusFileSize
new5.01 KB

The attached patch includes the above, plus includes the settings page menu entry that got dropped from #580432: Cache report and removes a bunch of lines that had only two blanks (per coding standards).