Hi, I have been using a theme based on Zen for a long time now and its functionality is great. However, a few days ago I tested my site with Bartik, just to compare performance and there is a big difference. On most of the pages Firebug shows cca 2 sec. waiting time with Zen, but Bartik has at least a second less of waiting time.

I decided to check if there's something wrong with my customization, but even when using the proper Zen, without any modifications, it stays the same.

I have removed all of the unecessary files, only one css file is used, scss is turned off, comments from php files are deleted... Nothing helps much.

Is there a way to speed up Zen somehow or at least a way to find out what exactly is causing these waiting times?

Comments

1mundus’s picture

It turns out that one preprocess_node function was causing slower performance. In this case it should be used in one content type only, so here is the code if someone needs preprocess_node per content type:

function THEMENAME_preprocess_node(&$variables) {

  $node = $variables['node'];
  if ($node->type == 'ARTICLE'){
  foreach (system_region_list($GLOBALS['theme']) as $region_key => $region_name) {
    if ($blocks = block_get_blocks_by_region($region_key)) {
      $variables['region'][$region_key] = $blocks;
    }
    else {
      $variables['region'][$region_key] = array();
    }
  }
  }
}
1mundus’s picture

Status: Active » Closed (fixed)