使用免费图像托管是否是 CDN 的可行替代方案?
这是我的情况:我在我的家用台式计算机上托管一个个人网站。我预计我的网站每天约有 1000 名访问者。问题是我的互联网连接速度不是很快(20 mbps 下载,4 mbps 上传)。
我网站上的大多数页面都有大约 2 MB 的图像。我正在考虑将这些图像上传到大约 10 个免费图像主机,并将直接链接存储在数据库中。每当我的网站需要加载图像时,我都会使用一个 PHP 脚本重定向到 10 个左右的 URL 之一,并确保每个 URL 获得相同的点击率。
这是处理带宽问题的好方法吗?
Here's my situation: 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只要您的图像不是关键任务就可以了。
请记住,您将依赖第三方来提供您的图像。这意味着如果他们更改有关图像外部链接的政策,或者您可能会发现您的网站没有任何图像。一个好主意是在您的网站上有一个备份副本,并使用第三方作为首选服务器,使用您的本地副本作为备份。
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.
我刚刚遇到 CloudFlare - 据我从他们的网站了解,你不需要做任何对您的网站的更改。显然,您所需要做的就是更改您的域名 DNS 设置。甚至提供免费选项。很想知道人们使用此 CDN 的体验如何。
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.