[wp-hackers] $wpdb cacheing?

Aaron Brazell emmensetech at gmail.com
Sun Aug 19 16:36:03 GMT 2007


WP instantiates the db data for a single blog and the cache mechanism revolves around that. I have not tried messing with double installs in the same db so my advice might be bunk, however your best bet is probably raw SQL.
(via Blackberry)
Aaron Brazell 
Director of Technology, b5media
"A Global New Media Company" 

web:: www.b5media.com, www.technosailor.com
phone:: 410-608-6620 
skype:: technosailor     

-----Original Message-----
From: Stephen Rider <wp-hackers at striderweb.com>

Date: Sun, 19 Aug 2007 03:59:01 
To:wp-hackers at lists.automattic.com
Subject: [wp-hackers] $wpdb cacheing?


Hi --

I'm trying to make a function that gets a combined list of Pages from  
two different blogs (both in the same database)

Since the login info is the same, it occurred to me to try changing  
the table prefix to get the second blog's data.  Here's the code:

$mbpages1 = get_pages( $args );
$orig_prefix = $wpdb->prefix;
$wpdb->prefix = 'blah_';
$mbpages2 = get_pages( $args );
$mbpages1 = array_merge( $mbpages1, $mbpages2 );
$wpdb->prefix = $orig_prefix;

It pulls the first blog's data twice.

Is the get_pages being cached somehow?  Is there a way to reset the  
cache so it pulls the different data?

....and if I do that, is there a way for me to cache the combined list  
and thus avoid a big performance hit?

My head hurts.  Thanks in advance.

Stephen
_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers


More information about the wp-hackers mailing list