[development] load node globally

Anthony Wlodarski anthony at thrillist.com
Thu Jan 15 21:53:27 UTC 2009

I believe any further calls to node_load with the same node id are cached.

Anthony Wlodarski
www.thrillist.com <http://www.thrillist.com>
Web Applications Developer
568 Broadway Ste. 605
New York, NY, 10012
(o) 646.786.1944

From: Ashraf Amayreh <mistknight at gmail.com>
Reply-To: <development at drupal.org>
Date: Thu, 15 Jan 2009 13:50:10 -0800
To: <development at drupal.org>
Subject: [development] load node globally

Hello All,

Since I see so many node loads in block visibility and in modules that do $node manipulations and so forth, which would make me think that sometimes many node loads might occur on some pages and tens perhaps when you add contributed modules on that, I was wondering why not just load $node globally on node/<num>/* pages like we do with $user to avoid any extra node_loads? Developers would only need to global $node and it would either be null or populated and ready.

Before creating a patch for a *possibly* terrible idea, I thought I'd raise a stick and see if it gets shot :D

Ashraf Amayreh

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20090115/55ff76c1/attachment.htm 

More information about the development mailing list