Quote:
Originally Posted by Rouzbeh1
the important thing is that i need this kind of links handling to lower the load on my servers
what i want is, to be able to add different Mirror Base Links in the Administrative Interface, and then ppl who add the entries would get 1 field for each mirror, where he must complete the remaining rest of the link
example :
Base URL for mirror 1 : http://mirror1.mysite.com/some_directory/
Base URL for mirror 2 : http://mirror2.mysite.com/a_directory/
|
I've given a lot of thought to this to see how to implement this cleanly, and this is my proposal.
Instead of having multiple url fields on the 'add entry' form, I've written an 'extra' that works alongside the LDM 'mod_rewrite' feature. This extra adds several new options to the LDM admin/settings page:
a) a url string to look for
b) one to five url strings to replace by
plus a couple of other switches.
When the extra is active, all LDM entries will be tested against the 'look for' string immediately before jumping/downloading. If they match, the 'look for' will be randomly replaced by one of the 'replace by' strings, in other words balancing the downloads across multiple servers.
This allows the admin to change the settings 'on the fly' withough having to edit all the entries.
This is, in effect, the same as the 'mod_rewrite' feature, except that it allows you to have a randomly-selected replacement. (If you are familiar with the Apache mod_rewrite moules, this is the effect of the ReplaceMap and rnd: options).
Please let me know if this is sufficient for your needs, so that I can finalise it.