0

Is there any hook for when the node_load or node_load_multiple functions are called, but before they are actually loaded from the DB?

I need this because I want to cache my nodes before Drupal goes and queries the DB for them.

5

No there's no such hook I'm afraid (see the list of hooks for Drupal 7).

If you want caching that goes beyond the normal static page cache provided by node_load() then you might want to look at the Entity Cache module, which "puts core entities into Drupal's cache API.". Even if you don't end up using that module you can inspect the code to get some ideas for implementing your own caching system.

  • Thanks. Installed this module and it reduced my number of queries from ~160 to ~70. It's great, but too advanced for me to understand. Guess it's fine for now :) – Eduard Luca Jul 3 '12 at 8:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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