Cache sometimes is not being updated on saving operations This is a problem I'm struggling with for a few months already. I'm maintaining a pretty big news website, with a lot of content and multiple editors. The website is using paragraphs (which I don't think is relevant to the core of the problem, but is relevant for the description of it) and Memcache modules. Editors can rearrange the blocks on the front page, add/edit articles etc. The problem is that occasionally (and sometimes pretty often) when editors will do something on the website (edit article, rearrange blocks), change won't be visible on the website. It won't be even visible in the edit form of the just edited node when they will try to edit it again. It will appear after few approaches.

I know that in fact the change is being made after the first time, because I can reappear it with the dmemcache_object()-&gt;flush();, which made me think that it is a problem with Memcache. However, I replaced it with Redis and there is no improvement.

Some more information about the problem:


Core cache is basically disabled as we are caching everything in the CDN, but editors have direct access to the website, without CDN, and experience this problem there, so it is not CDN related. Below are website's cache settings.





I cannot reproduce the problem locally, even if I'm also using Memcache/Redis.
Sometimes when they are creating a new node with paragraphs, it appears "empty". During the edit, there are also no paragraphs. However dmemcache_object()-&gt;flush(); seems to fix this problem and makes everything appear (I tried it few times).
I tried even to add dmemcache_object()-&gt;flush(); to the save/update hooks, but it didn't help.


Any ideas of what can I do to diagnose and fix this problem? It is particularly hard to approach because it happens only on the production server.

Added #1:
When using redis module, and adding to settings.php:

$conf['path_inc'] = 'sites/all/modules/contrib/redis/redis.path.inc';


Problem expanded on paths. Some nodes had paths in the form of node/[node_id], but after removing this line, and clearing cache - proper, aliased paths has been restored.

Note: database is located on the different server.
Try Expire module  instead you try to clear cache manually.


  This module provides configurable actions upon events that will expire
  URLs from caches like reverse proxy caches, internal page caches,
  etc.This module make more sense when Minimum Cache Lifetime setting is
  set to a value other than none.
  
  There is now integration with the following modules:

Boost - deletes expired pages (files) from the file system.
Varnish - integrates over an administrative socket.
Fastly - Varnish/CDN caching
Purge - expires urls by sending purge requests to Varnish, Squid and Nginx over HTTP.
Acquia Purge - allows Drupal sites hosted on Acquia Cloud to automatically purge pages from their Varnish powered load balancers..
Memcache Storage - allows to delete pages that were cached in a memcached instances.
Akamai - provides an integration with the Akamai Cache Control Utility (CCU) Web Service
Recacher - Page cache warmer.



and Memchache Storage mdoule 

Features

This module is an alternative to Memcache API and Integration module focused on different set of features. Available features (D7):

    You can move all cache to the memory.
    You can move users' sessions to the memory.
    You can move lock system to the memory.
    Module can store cached pages for anonymous users as a plain text, so proxy servers (like Nginx with enabled ngx_http_memcached) can get such pages directly from memcached pool and avoid heavy requests to the backend.
    You can clear data from single cache bin, cache cluster or flush all cached data from Drupal UI (screenshot).
    You can find helpful nice debug output (screenshot).
    Integration with Drush
    Integration with Administration menu. Module provides link for flushing memcached data from navigation toolbar.
    Active development and support.