Having access to a box in the US, I thought it would be nice to have some way to automatically serve static files off my websites through it, while leaving the primary server and dynamic content in New Zealand. What I wanted was Akamai. What I didn't want was to pay for it. So it's wheel reinvention time. And therefore, the Patrick-named moo net now has some working code, namely some perl that extracts route lists from the WIX and APE looking glasses, and summarises the routes.
The other major, exciting code is the code that will be called by the rewrite rules to decide which mirror machine to use. It's written in C++ for efficiency. I hadn't written any C++ for a while. And this is STL-using C++, which I haven't really touched since 2001. And it works! The config files it parses are ugly, but I'll survive :-)
Still to be done is configuring squid and apache to run on the mirror boxes, which will require writing a squid URL rewriter (which I will write in perl), and probably making up some hashing scheme so that random people can't use the CDN without at least asking nicely first.
Other stuff to do is making up the mod_rewrite rules, and writing another short C program to generate those hashes to call from it. And to persuade someone with a box near WIX with free national traffic to let me run a mirror node on it. Then the only stuff going out my cable modem will be dynamic content, and static content for the mirrors. Which will be nice.
Comments:
The idea is that more people than just me would use it.
getMeTheMooServer() would be a pain to implement efficiently in PHP using the same config files as the mod_rewrite handler -- but I think I may have a way around that. And it would probably be more of getMeTheMooedURL($url) -- because mooed URLs will look something like
http://quirm.cdn.moo.net.nz:4200/patrick/04cd923ba84/http://decade.geek.nz/wherever/your/images/live.jpg
[...] 5 moo net, simplified Filed under: General — donald @ 4:58 pm Well, the old moo net design looked like it required too much work up front, so it’s not going to happen like th [...]
Progress! What I'd be interested in doing is developing some kind of interface to this so I could, say, find out the server from, say, a PHP script to remove the need for the redirects. So my script could say something like $proxyBase = getMeTheMooServer(); and then img src=$proxyBase/image.jpg... and img src=$proxyBase/image2.jpg or a href=$proxyBase/download.zip. This, of course, assumes that you'll let me in to the field of MooNet.