如何加快地球另一侧的网站加载速度

发布于 2024-12-22 14:39:39 字数 389 浏览 2 评论 0原文

我目前正在运行一个小型 PHP 软件,该软件由两组人访问,一组在中国,另一组在爱尔兰。服务器托管在爱尔兰,毫无疑问,页面加载时间在 0.3 到 0.8 秒之间。

中国人的录音时间在3.0秒到10秒之间。

我进行了速度测试,中国人的互联网连接速度为 1.5 mbit(测试服务器位于爱尔兰),ping 值为 750 毫秒。

到目前为止,为了缩短加载时间,我重做了很多 MySQL 数据库交互以最大限度地提高效率,但这并没有帮助。我认为这只会稍微减少服务器处理时间,但对页面下载时间影响不大。

我在想,我可以在中国托管,并将其用作爱尔兰系统的网关吗?当然,这个中国服务器之间的延迟和下载速度会比普通人更好。并且普通人的请求将重新路由到这里。

这听起来可行吗?或者其他人有与此相关的建议吗?

I am currently running a small piece of PHP software which is being accessed by two groups of people, one group in China, the other in Ireland. The server is hosted in Ireland, and no doubt pages load between 0.3 and 0.8 seconds.

The Chinese people are recording times of between 3.0 seconds and 10 seconds.

I have run speed tests and the Chinese have an internet connection of 1.5 mbit (testing server in Ireland) and a ping of 750ms.

So far, to improve load time I have redone a lot of the MySQL database interaction to maximize efficiency, but this did not help. I presume this only slightly reduces server process time but has little effect on page download time.

I was thinking, could I get hosting in China, and use this as a gateway for the system in Ireland. Surely the latency and download speed between this Chinese server would be better than the average person.. And the average persons requests would've re-routed through here.

Does this sound at all feasible? Or does anyone else have suggestions in relation to this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

笔落惊风雨 2024-12-29 14:39:39

您最大的问题是延迟。如果您可以最大限度地减少 http 请求,您应该会看到巨大的收益。

但是,购买内容交付网络的服务并将所有静态文件移动到它们,确保它们在中国和爱尔兰拥有良好连接的服务器可能更容易。我认为这比重新设计您的网站更容易。

最便宜的方式是发送合适的 http 标头,以向 Web 浏览器表明它们不需要不断检查您的服务器以进行新鲜度验证(不要执行有条件的 http 请求)。如果您可以对所有外部网页对象(图像、CSS、JS 等)执行此操作,那么第一个页面加载仍将需要 10 秒或其他时间,但后续页面加载应该非常接近您的爱尔兰访问者。这只是网络服务器配置的问题。如果需要,这里是教程。老实说,发送缓存友好的标头始终是一个好主意,这就是您获得我们都喜欢的快速响应网站的方式。

Your biggest problem is the latency. If you can minimize the http requests, you should see large gains.

But, it's probably easier to just the buy services of a content delivery network and move all your static files to them, making sure they have well connected servers in china and ireland. I think this is easier than redesigning your website.

The cheapest bang for the buck would come from sending suitable http headers to indicate to the web browsers that they don't need to constantly check with your servers for freshness validation(don't do conditional http requests). If you can do this for all external webpage objects(images, css, js etc...) then the first page load will still take 10 seconds or whatever, but subsequent page loads should be very close to your irish visitors. THis is just a matter of webserver configuration. Heres a tutorial if needed. To be honest, sending cache friendly headers is always a good idea, this is how you get those snappy responsive websites we all love.

梦幻的味道 2024-12-29 14:39:39

首先遵循最佳实践来加速您的网站。然后还要检查YSlow 来衡量您网站的速度并检查您可以采取哪些措施来提高性能。
我认为更换服务器不会给你更好的响应时间。
我认为您应该首先担心优化,然后检查是否有良好且强大的托管公司和托管计划。

干杯

First of Follow best practices to speed up you website.Then also check YSlow to measure your site's speed and check what you can do to improve performance.
I think that changing servers won't give you better responce time.
I think you should worry first for optimization and then check for a good and powerful hosting company and hosting plan.

Cheers

梦太阳 2024-12-29 14:39:39

在中国托管/镜像绝对是最佳选择。对于那里的人们来说,这会更快、更可靠。理想情况下,您也可以将其托管在爱尔兰,并进行某种负载平衡。

Hosting/mirroring in China is definitely the way to go. It'll be faster for the people there and more reliable. Ideally you would also have it hosted in Ireland too, and have some kind of load balancing in place.

倾城°AllureLove 2024-12-29 14:39:39

我肯定会将您的网站镜像到亚洲某个地方的服务器。您已经做了一些性能改进,但在中国并没有带来更好的结果,因此我认为网络延迟导致了大部分加载时间。

您可以将您的网站部署到其中一项云服务。例如,Amazon EC2 实例已在新加坡和东京推出。或者您可以部署到中国的“常规”网络托管服务商。

如果您必须提供大部分静态文件,请检查内容分发网络 (CDN) 服务。

I would definitely mirror your site to a server somewhere in asia. You already did some performance improvements that didn't result in much better results from China so I assume the network latency is causing most of the load times.

You can deploy your website to one of the cloud services. Amazon EC2 instances are available in Singapore and Tokyo for example. Or you can deploy to a "regular" web hoster in China.

If you have to deliver mostly static files, check for a Content Distribution Network (CDN) service.

-柠檬树下少年和吉他 2024-12-29 14:39:39

为了加快加载时间,您可以考虑将静态文件(图像、CSS、JavaScript、文档)托管到 CDN(内容交付网络)。 CDN 的工作原理是将您的文件托管在世界各地的多个节点中。一旦收到请求,距离访问者最近的服务器将提供文件服务,从而减少延迟。

您可能想尝试 CloudFlare (http://cloudflare.com),它是一款免费产品,可用作您网站的反向代理和 CDN。 CloudFlare 将不是用户直接访问网站,而是访问您的网站并对其进行优化以交付给访问者。

To speed up the load time, you may consider hosting your static files (images, css, javascript, documents) to a CDN (Content Delivery Network). CDNs work by hosting your files in multiple nodes around the world. Once it receives a request, the closest server to the visitor will serve the file - thus reducing latency.

You may want to try CloudFlare (http://cloudflare.com), it's a free product that serves as a reverse proxy and CDN of your website. Instead of the user accessing the site directly, CloudFlare will be the one to access your site and optimize it for delivery to the visitor.

活泼老夫 2024-12-29 14:39:39

我正在做同样的事情。我会在阿里云云上创建一个站点镜像。我在新加坡的 siteground 托管我的网站 (www.discoverwish.com),但没有 VPN 的中国用户的加载时间非常慢。

我将使用 rsync 来保持信息同步,然后使用 DNSpod 重定向中国用户

I'm in the process of doing the same thing. I will create a site mirror on aliyun.com cloud. I'm hosting my site (www.discoverwish.com) at siteground in singapore, but load times for my Chinese users without VPN is incredibly slow.

I will use rsync to keep the information sync'd up, then redirect chinese users using DNSpod

花期渐远 2024-12-29 14:39:39

关于此评论:“您可能想尝试 CloudFlare (http://cloudflare.com),它是一款免费产品,可提供作为您网站的反向代理和 CDN,CloudFlare 将访问您的网站并对其进行优化以将其交付给访问者,而不是直接访问该网站。”

我们为中国的客户尝试过这一点,但不幸的是,CloudFlare 还没有在中国运行的本地 CDN 版本。我们目前正在测试亚马逊的 CDN,似乎获得了积极的评价。

Regarding this comment: "You may want to try CloudFlare (http://cloudflare.com), it's a free product that serves as a reverse proxy and CDN of your website. Instead of the user accessing the site directly, CloudFlare will be the one to access your site and optimize it for delivery to the visitor."

We tried this for a client in China but, unfortunately, CloudFlare don't yet have a local version of their CDN working in China. We are currently testing Amazon's CDN, which seems to have positive reviews.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文