Warning: Undefined array key "HTTPS" in include() (line 29 of /opt/www/fdv2/drupal.stage/web/sites/default/settings.local.php).
include('/opt/www/fdv2/drupal.stage/web/sites/default/settings.local.php') (Line: 4)
require('/opt/www/fdv2/drupal.stage/web/sites/drupal001.net/settings.php') (Line: 145)
Drupal\Core\Site\Settings::initialize('/opt/www/fdv2/drupal.stage/web', 'sites/drupal001.net', Object) (Line: 1099)
Drupal\Core\DrupalKernel->initializeSettings(Object) (Line: 701)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Drupal的缓存,如何让不同主题的缓存不冲突? - Drupal大学 - Drupal问答论坛
首页 / 帖子
Drupal的缓存,如何让不同主题的缓存不冲突?

Drupal 里面动态切换主题,但是 cache 依赖于theme 的tpl,所以导致不同主题的 cache 出现 bug,如何解决?
总体来说,就是想根据不同的主题,缓存内容不一样,如何解决?

谢谢!

1个答案
老葛
发布于:2016-04-02 15:17

如果是自定义缓存的话,比较简单,设置一下 cache 的 cid,给 cid 里面添加 theme 信息,比如:

global $custom_theme;
$cid = $cid . $custome_theme;
cache_set($cid, $data);

这样就把 cid 跟 theme 对应起来,不同的 theme 有不同的 cache。