On production site I am facing wearied issue, When I update the content to page or block content. Then I see old content of first refresh of page then it keep fluctuating with old and new content , until I flush the cache or clear cache the new content is not visible

settings['memcache']['bins'] = ['default' => 'default'];
$settings['memcache']['key_prefix'] = 'cms_prod_memcache_';
$settings['memcache']['persistent'] = TRUE;
$settings['cache']['default'] = 'cache.backend.memcache';
$settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.memcache';
$settings['cache']['bins']['render'] = 'cache.backend.memcache';
$settings['container_yamls'][] = $app_root . '/modules/contrib/memcache/example.services.yml';

Please let know the solution if any one facing.

Comments

anisha786 created an issue.

djmymy’s picture

hi anisha786!
I as well am dealing with the same exact issue. Going to investigate more on this issue. Once I disabled Memcache I didn't have the issue. Will need to see why.

minoroffense’s picture

Happens in D7 as well. Had to exclude cache_bootstrap from using memcache. Couldn't save variables, update information was out of date, lots of weird behaviors.

djmymy’s picture

I was able to solve this issue with this article. Not sure about D7. I will see if I see anything around D7. Memcache Drupal 8 Fix

j.b’s picture

I am getting the same issue, after moving servers. The memcached is a AWS cluster.

Having this issue both in the back office and on the front. After editing a content and when i again view the node edit form, I get the old and new values randomly.

Doing a flush_all on the memcache install each time, corrects the issue.

Any idea what causes this ?

slejnej’s picture

Hello,

any news on this? We are using D10.2 with php8.1 and saving menu, or any admin settings changes do not clear memcached.

Thanks

rifas-ali-pbi’s picture

Hai even we had this issue. And it took us a while to debug this issue. We did two things.

1) Made AWS elastic host into 2 nodes.
2) Then used those 2 nodes in settings.php

Below is the configuration code for the memcache.

$memcache_hosts = getenv('MEMCACHED_HOST') ?: 'memcached';
$memcache_port = getenv('MEMCACHE_PORT') ?: '11211';


// Shared Memcache server definition
$memcache_servers = [];
foreach (explode(',', $memcache_hosts) as $host) {
  $host = trim($host);
  if (!empty($host)) {
    $memcache_servers["{$host}:{$memcache_port}"] = 'default';
  }

if (getenv('ENV') == 'prod') {
  $config['config_split.config_split.local']['status'] = FALSE;
  $config['config_split.config_split.acceptance']['status'] = FALSE;
  $config['config_split.config_split.prod']['status'] = TRUE;

 //Memcache configs 
  $settings['memcache']['servers'] = $memcache_servers;
  $settings['memcache']['bins'] = ['default' => 'default'];
  $settings['memcache']['key_prefix'] = 'MigrationYorkshire';

  $settings['cache']['default'] = 'cache.backend.memcache';
  $settings['cache']['bins']['render'] = 'cache.backend.memcache';
  $settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.memcache';
  $settings['cache']['bins']['data'] = 'cache.backend.memcache';
  $settings['cache']['bins']['entity'] = 'cache.backend.memcache';
  $settings['cache']['bins']['menu'] = 'cache.backend.memcache';
  $settings['cache']['bins']['page'] = 'cache.backend.memcache';

  $settings['cache']['bins']['bootstrap'] = 'cache.backend.database';
  $settings['cache']['bins']['discovery'] = 'cache.backend.database';
  $settings['cache']['bins']['config'] = 'cache.backend.database';
  $settings['container_yamls'][] = DRUPAL_ROOT . '/sites/default/memcache.services.yml';
}


}