ajax请求经常超时,如何解决?
好像从来没有发生过这样的事情,他们是不是用了什么特殊的技术?
It seems such things never happened to SO,did they use some special technique?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
好像从来没有发生过这样的事情,他们是不是用了什么特殊的技术?
It seems such things never happened to SO,did they use some special technique?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
这不是一个真正的问题,而是一些琐碎的建议:
This isn't a real question, but some trivial advice:
分析您的代码以确保它是
快速。
检查服务器响应时间。
致力于服务的绩效。
Profile your code to make sure it is
fast.
Check server response times.
Work on performance of your service.
确保您使用 Firebug 超时并查看错误代码。
如果这是真的并且你真的超时了
找出服务器端发生的情况,输入 AJAX 调用服务器端的脚本,输入相同的参数,看看会发生什么,独立于 AJAX 进行调试,修复问题并编写一些测试以确保它成功不再出现
(或者如果确实如此,您就会知道问题是什么)。
Make sure you're timing out using Firebug and see the error code.
If it's true and you're really timing out
Find out what's going on the server-side, go and feed the script AJAX is calling server-side, feed it the same arguments and see what happens, debug it independently of AJAX, fix the problem and write some tests to make sure it won't come up again
(or if it does you'll know what's the problem).