Old Content Show after updating the content using Memcache Api

Created on 18 July 2020, about 5 years ago
Updated 11 November 2021, over 3 years ago

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.

💬 Support request
Status

Active

Version

2.0

Component

memcache_admin

Created by

🇮🇳India anisha786

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom slejnej

    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

  • 🇮🇳India rifas-ali-pbi Kerala

    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';
    }
    
    
    }
Production build 0.71.5 2024