Community CDN
Categories
Component ID
Component name
Component type
Maintenance status
Development status
Component security advisory coverage
Component created
Component changed
Component body
CCDN is a peer-to-peer Content Distribution Network for the Community.
How it works:
We Install it (you and me)
yourserver.com and myserver.com
We add a trust network (a list of servers you trust )
on your server:
myserver.com | png, jpg | upto 1g | 6 hours
example.com | tar.gz, zip | upto 10g | as long as needed
example2.com | jpg, png, gif, flv | upto 200g | always
on my server
yourserver.com | png, jpg, zip, gz | upto 500m | a week
If a server is over loaded and the other server is idling the server overloaded (yourserver.com eg) says help to all the others in the trust list.
For each of the servers that say yes I'll help
by sending e.g. :
I'll host
png, jpg, zip, gz
upto 500m
for a week
add http://myserver.com/files/ccdn/yourserver.com to your uri's
The yourserver.com then starts adding http://myserver.com/files/ccdn/yourserver.com into the url's of it's images e.g.:
from<img src=/files/image.png />
to<img src=http://myserver.com/files/ccdn/yourserver.com/files/image.png />
and takes note of the file and which friendly server is looking after it, ideally on each page load giving a equal share to each friendly server with in the constrates of you "i'll help" message and then asks myserver to get it. Just by asking for it (like http_get("http://myserver.com/?q=files/ccdn/yourserver.com/files/image.png")
)
My server then downloads it ONCE from your server (if it's a png, jpg, zip, or gz and it was ask for by the ip address of yourserver.com ) and lets people download it, easing the load on your server. When the 500m is reached the oldest is deleted until the folder is less than 500m. When the time is up:
my server says to your server
You okay now?
your server
Yes I'll stop linking to you and clear my page cache. Thanks for helping
my server
Glade too. I'm deleting your files for my server in 24 hours giving time for your customers time to get the new pages and add a 301 redirect back to your file on you server
your server
Cool
my server deletes the files from the Directory files/ccdn/yourserver.com
in 24 hours on cron as it dus it add the 301 redirect in the .htaccess file in /files/ccdn/yourserver.com
arpieb's idea to add soon:
Additionally allow a bandwidth cap for the alternate servers as you wouldn't want a volunteered box to tap out its bandwidth and cost the owner money. Odds are if the original server is getting hammered, this is a very real possibility.
Good point arpieb
Adding 301 redirect arpieb idea again thanks
I'd love to add a location switcher but in a lazyload script so the server can just give one page with optional uri's and the javascript picks the closest or the quickest.