Hi all,

I'm doing some profiling of a site using homebox, and noticed that homebox_get_page is firing multiple times on the same page and running the following query repeatedly. It seems like a perfect candidate for static caching. Is there something I'm missing or can we easily add a static variable here?

Thanks!


 */
function homebox_get_page($name) {
  // Fetch page from db
  $page = db_fetch_object(db_query("SELECT * FROM {homebox_pages} WHERE name = '%s'", $name));

Comments

drumm’s picture

+1

Same for the user page.

nnewton’s picture

Just to be clearer, I mention static caching in the original issue...but it seems like this would be a good candidate for cache_get/set as well. Especially as if name is empty, this is read as impossible by mysql which is quite fast but also doesn't get into the query cache.

-N

mstef’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev

I'm not sure if I see how static caching could even be possible or useful with a module like this.

drumm’s picture

Status: Active » Closed (duplicate)