Switch_to_blog – is it really taxing on the frontend?
-
Hi,
I run a medium sized MS network (~100 sites – 8mln pageviews a month).I need to broadcast some posts from one site to another, but I’ve read on the codex that switch_to_blog() should not be used on the frontend as it is very taxing.
Just to be sure, I’ve made a little experiment on my local install, and created a simple shortcode that queries posts from another blog.
[ms-posts blog=”blog-id” cat=”cat” tag=”tag”]
which outputs a simple list of posts taken from the blog and taxonomies specified in the shortcode arguments.
Now, from opening a post/page where the shortcode is included to opening a post/page where the shortcode is not included I see very little differencies in performance (just one more query called by WP_Query->get_posts).
Am I doing something stupidly wrong and cannot see the dangers of switch_to_blog()?
Or using it in this way (to query just one blog) is fine?thanks ??
best
- The topic ‘Switch_to_blog – is it really taxing on the frontend?’ is closed to new replies.