Cache problem: update node I am running a Drupal 7 website with "Cache pages for anonymous users" and "Cache blocks" enabled. Both "Minimum cache lifetime" and "Expiration of cached pages" are set to 1 day.

When I update a node, for example, edit a picture, and visit that page as an anonymous user, the new picture isn't being displayed. When I manually clear the cache the page is displayed as it should be. It's like the cache isn't cleared after the node is updated.

Extract of the API:

modules/node/node.pages.inc

function node_form_submit($form, &amp;$form_state) {
  $node = node_form_submit_build_node($form, $form_state);
  $insert = empty($node-&gt;nid);
  node_save($node);

  // Do stuff...

  // Clear the page and block caches.
  cache_clear_all();
}


Notice that the function cache_clear_all is called after the node is saved, regardless if the node needs to be inserted or updated.

Further inspection of the API reveals the following:

modules/node/node.module

function node_save($node) {

  ...

    // Save the node and node revision.
    if ($node-&gt;is_new) {
      drupal_write_record('node', $node);
      ...
    }
    else {
      drupal_write_record('node', $node, 'nid');
      ...
    }

    ...

    // Clear the static loading cache.
    entity_get_controller('node')-&gt;resetCache(array($node-&gt;nid));

  ...
}


Again, everything seems to be as it should be. The cache is cleared using the Entity API (public DrupalDefaultEntityController::resetCache(array $ids = NULL)).

Nothing seems to be wrong in the code. Maybe the code doesn't clear all of the necessary cache?
The problem is that you have a minimum lifetime of 1 day set. This means cache_clear_all() will not remove entries with a lifetime of less than a day. Try setting this to 1 hour, or something more acceptable for your site (eg, how long between new content or edited content, and when an anonymous user needs to see the content).