Caching 缓存没有被清除?
在我的内容类型中,我有一个默认值为0的字段(fieldfbunique);通过编程,我使用下面的代码将其值更改为1,并清除缓存 该值更改为1,但当管理员用户编辑节点时,字段值显示为0,即使数据库中的值为1(如预期) 但是,要将其显示为1,我需要手动清除缓存。我已经启用了MemcachedCaching 缓存没有被清除?,caching,drupal-7,memcached,Caching,Drupal 7,Memcached,在我的内容类型中,我有一个默认值为0的字段(fieldfbunique);通过编程,我使用下面的代码将其值更改为1,并清除缓存 该值更改为1,但当管理员用户编辑节点时,字段值显示为0,即使数据库中的值为1(如预期) 但是,要将其显示为1,我需要手动清除缓存。我已经启用了Memcached $node = node_load($nid); $node->field_fbunique['und'][0]['value'] = 1; field_attach_presave('node', $n
$node = node_load($nid);
$node->field_fbunique['und'][0]['value'] = 1;
field_attach_presave('node', $node);
field_attach_update('node', $node);
$nodeurl = url('node/'. $nid);
cache_clear_all($nodeurl, 'cache_page');
entity_get_controller('node')->resetCache(array($nid));
drupal_flush_all_caches();
借助此代码将
表单缓存
从内存缓存
中排除,它开始为我工作:
$conf['memcache_bins'] = array( 'cache' => 'default', 'cache_form' => 'none', );