0

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

  • So to clarify the goal would be for all media URLs to be replaced with one of three sub domains media[1,2,3].domain.com. Not sure it would be a good idea to add a 30X redirect, as that creates an extra overhead. So maybe my real question is whether there is an existing plug-in. –  Oct 10 '08 at 22:18

2 Answers2

1

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
  • 106
  • 1
  • 2
  • 9
0

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 Al-Maadeed
  • 5,654
  • 5
  • 28
  • 48