我有一个块,它显示来自外部站点的RSS feed列表。我想继续缓存除提到的块以外的其他块。怎么做?
例如,我有blockA,blockB和blockC。我只想永久地将blockB的缓存设置更改为DRUPAL_NO_CACHE其他块,而其他块则保持不变,而我想以编程方式进行操作。
您可以在创建您的块的特定模块中更改缓存角色。在下面的块信息中:
function pref_block_info() {
return array(
'pref_main' => array(
'info' => t('Display flash game for auth. users'),
'cache' => DRUPAL_NO_CACHE,
),
'pref_winner' => array(
'info' => t('Show the winner of the last week.'),
'cache' => DRUPAL_NO_CACHE,
),
'pref_leader' => array(
'info' => t('Show the leader of the current week.'),
'cache' => DRUPAL_NO_CACHE,
),
'pref_top' => array(
'info' => t('Show the top 10 of the current week.'),
'cache' => DRUPAL_NO_CACHE,
),
);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2357 次 |
| 最近记录: |