views:

781

answers:

2

So the question is how to distribute/offload the media files from Wordpress posts across multiple domains.

The reasoning being to overcome this limitation: "Most browser will only make 2 simultaneous requests to a server, so if you page requires 16 files they will be requested 2 at a time."

In relation to: http://codex.wordpress.org/WordPress_Optimization/Offloading

To further clarify:
There are two plug ins for "offloading" that already do this. They are the SteadyOffloading Plugin and the Amazon S3 plugin.
So is there a generic solution that anyone has come across. Where it will allow you to change the base URL of the media, it doesn't necessary have to upload that media to an external service/server.

Thanks

A: 

The question is a bit ambiguous, I'm not sure but maybe if the domains are on the same server you could replace wp-content/uploads by a symlink.

Osama ALASSIRY
+1  A: 

You just need to edit the URL's to the various media files throughout your WordPress theme.

For example, edit you "header.php" to change the css file to an alternate domain.

Change This:

print("<link rel="stylesheet" type="text/css" media="screen" href="<?php bloginfo('stylesheet_url'); ?>" />");

To something like this:

print("<link rel="stylesheet" type="text/css" media="screen" href="http://www.NEW_DOMAIN.com/theme/stylesheet.css" />");

All the media could then be placed on this alternate server and would be referenced by the stylesheet.

The same could be done for any pictures or other media. There are even several WP plugins for utilizing media services such as Flikr.com

If you actually have several physical servers to utilize, you would install WordPress on the base web server "www.DOMAIN.com" server. Then all your images could all reside on an second server "images.DOMAIN.com". Next you could place your stylesheets and JavaScript files on a third sub-domain/server, "scripts.DOMAIN.com". Then your 1st. server would refer to the stylesheet on the 3rd server which would access all the media files on the 2nd server.

If you owned all your own hardware, you could get really crazy and use some sort of script to mirror all the files between 2 servers and use a Hardware Load Balancer to split the web traffic and use Log shipping to mirror you database between multiple servers... But that is getting a bit ridiculous.

Hope this helps.

-Jordan

Jordan Ogren
What is incorrect about this answer? I see that there is a negative vote, but there is no response with an alternative solution.
Jordan Ogren
I don't know, Jordan... it seems reasonable to me :)
warren