Would using free image hosting be a viable alternative to a CDN?
Here's my si开发者_如何学运维tuation: I'm hosting a personal website on my home desktop computer. I expect my site to have around 1000 visitors per day. The problem is that my Internet connection isn't very fast (20 mbps download, 4 mbps upload).
Most of the pages on my site have around 2 MB of images. I'm thinking of uploading those images to around 10 free image hosts and store the direct links in a database. Whenever images need to be loaded for my site, I have a PHP script make a redirect to one of the 10 or so URLs and ensure that each URL gets equal hits.
Would this be a good way of dealing with the bandwidth issue?
As long as your images aren't mission critical then it's fine.
Just remember you'll be relying on a third-party to serve your images. This means if they change their policies regarding external linking to images, or w/e you may find your site doesn't have any images. A good idea would be to have a backup copy on your website and use the third-party as the preferred server, using your local copy as a backup.
I've just come across CloudFlare - from what I understand from their site, you shouldn't need to make any changes to your website. Apparently all you need to do is change your domain names DNS settings. Even provides a free option. Curious to see what peoples experiences with this CDN are like.
精彩评论