Why is it that node_delete (which calls node_delete_multiple) empties all node cache even though it has the list of specific nids?

I have 200K+ records, all of which I would like to cache pre-emptively by entitycache module + Drush Entity Cache Loader (ECL). This is (obv) an expensive operation - but deleting even one node empties entire cache.

I realize that I can simply modify entitycache module to do exactly what I want - but I am just wondering about the rationale behind emptying entire cache.

  • How can we know? DrupalEntityControllerInterface::resetCache(array $ids = NULL) accepts list of IDs, but only developers can know why they decided not to use it in this case. And if you want to ask them, you should post a support request on drupal.org - here we could only guess and provide our opinions - not what this site is for.
    – Mołot
    Mar 28, 2014 at 8:11

2 Answers 2


One reason i see is Entity Reference...

For Example -

  • A block which lists some nodes part of your delete list.
  • A node which has entity reference to your deleted node
  • A view page which has some of your deleted nodes

Reason for clearing all the caches: When a node is created/updated/deleted there can be many pages in the site which are dependent on the current node in question. It is next to impossible/very difficult identify all the dependencies and clear the caches only for those pages. For this particular reason, to make sure that no stale data is served to the end user drupal by default clears all the caches.

So, It makes sense to Clear the page and block and node_load_multiple caches as documented in node_delete_multiple function.


Short Answer : This is as per design. You are relying on Page Caching and it cannot differentiate whether it is a node page or any other page. So it clears all the caches. But you can override this behavior.

If you want to know more about why it is as per design read my answer Whenever I edit/update a node all the page caches for anonymous user are lost

In the answer I have also included the possible work-around for the same.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.