问题描述
我有一个浏览器游戏,最近我开始为游戏添加音频。
Chrome无法加载整个网页,并被卡在91个请求| 8.1 MB转移加载更多内容,甚至在所有其他标签页中刹车<等待可用套接字。
5分钟后(正好)数据被加载。
这不会发生在任何其他浏览器上。
删除一个MP3文件(最新添加的一个)修复了这个问题,所以我猜想它的数据限制问题?
看起来您正在按每个服务器限制连接。我看到你正在加载大量的静态文件,我的建议是将它们分开在一个子域中,并直接用Nginx提供它们。
-
创建名为 img.yoursite.com的子域并加载所有图像
从那里。 创建一个名为 scripts.yourdomain.com的子域名并从那里加载所有的JS和CSS文件。 -
创建一个名为 sounds.yoursite.com 的子域,并从那里加载所有MP3 ......等等。
Nginx有很多选项可以直接提供静态文件和管理静态文件缓存。
I've got a browser game and I have recently started adding audio to the game.
Chrome does not load the whole page and gets stuck at "91 requests | 8.1 MB transferred" and does not load any more content and even brakes the website in all other tabs saying Waiting for available socket.
After 5 mins (exactly) the data are loaded.
This does not happen on any other browser.
Removing one MP3 file (the latest added one) fixed the problem, so I guess its a data limit problem?
Looks like you are hitting the connection per server limit. I see you are loading a lot of static files and my advice is to separate them on a subdomains and serve them directly with Nginx for example.
Create a subdomain called img.yoursite.com and load all your imagesfrom there.
Create a subdomain called scripts.yourdomain.com and load all your JS and CSS files from there.
Create a subdomain called sounds.yoursite.com and load all your MP3s from there... etc..
Nginx has a great options for directly serving static files and managing the static files caching.
这篇关于Chrome在传输了一定数量的数据后挂起 - 等待可用套接字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!