DNS查找简单的C#/ asp.net ajax调用非常慢 [英] DNS Lookup in simple C#/asp.net ajax call is extremely slow

查看:235
本文介绍了DNS查找简单的C#/ asp.net ajax调用非常慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



这个想法是使用jQuery的所有ajax请求,而不是.net,遵循一些在线教程。



Default.aspx - > HTML页面,Default.aspx.cs中的jquery触发器方法



http://pastebin.com/pxBvKA2H



Default.aspx.cs - > C#Webform,只是定义了一个GetDate函数,它现在只返回一个字符串(试图消除任何可能的问题)



(只能发布一个超链接...)pastebin.com/pnHn50hu



ajax查询所花费的时间要长于它。使用firebug进行分析显示需要1.03 ms。



1s DNS查找|
26ms Waiting |
1ms收到



编辑:如果您继续点击并重新提交请求,则继续采用相同的时间。



有什么我可以做的,以减少DNS查找时间/我做错了什么?

解决方案

在调试模式下运行网站后,将浏览器中的URL从localhost:####更改为127.0.0.1:####,看看是否有所作为。我最近才发现,


I'm running this out of the VS 2008 debugger on Windows 7, running .Net 3.5.

The idea was to make all ajax requests with jQuery only, rather than .net, following some tutorials online.

Default.aspx -> HTML page, jquery triggers method in Default.aspx.cs

http://pastebin.com/pxBvKA2H

Default.aspx.cs -> C# Webform, just defines a GetDate function, which only returns a string for now (trying to eliminate any possible issues)

(can only post one hyperlink...) pastebin.com/pnHn50hu

The ajax query takes longer than it should. Profiling with firebug revealed that it took 1.03 ms.

1s DNS Lookup | 26ms Waiting | 1ms Receiving

EDIT: It continues to take the same set of times if you continue to click and resubmit the request.

Is there anything I can do to cut down on the DNS Lookup time / what did I do wrong?

解决方案

After you get site running in debug mode, change your URL in the browser from localhost:#### to 127.0.0.1:#### and see if that makes a difference. I found recently that it did.

这篇关于DNS查找简单的C#/ asp.net ajax调用非常慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆