Hi guys, I've found that caching is not working very well with current SQL statements, I've made the following changes but I'm not sure if this is ok. I do think that at least caching is working now (mysql and wp_object)
@@ -190,24 +190,28 @@
if ($type == 'posts') {
$results = $wpdb->get_results("SELECT
ID
,post_date_gmt
FROM ".$wpmuBaseTablePrefix.$blogid."_posts
- WHERE post_status
= 'publish' AND (post_type
= 'post' OR post_type
= '') AND post_date_gmt
< '".gmdate("Y-m-d H:i:s")."'
+ WHERE post_status
= 'publish' AND (post_type
= 'post' OR post_type
= '')
The thing is, posts don't get publish status until they get published (either cause of the publish date in the future or cause the author has not published it yet), so we don't really need checking post_date_gmt -- that is causing different SQL statement every time the feed is called.
Please correct me if I'm wrong!
(tested with adding a timer at the end of feed and then reloading the feed page)
Regards,
Marko