开发者

Response time of web application using different url

I have a very basic doubt regarding web application url.

Suppose a web application is running locally on my machine.

Will the开发者_运维百科re be any difference in the response time if I access the application using below two url ?

http://localhost:8080/SomeApplicationContext

http://hello:8080/SomeApplicationContext -- Assuming my machine name is hello


depends on whether or not you have hello in your hosts file. (same place where localhost is defined) if its not, then yes because your computer will have to check with DNS before it can access the resource, in which case the difference will close to the round trip latency of that request.


No difference, You can run the script/coding using http://localhost:8080/SomeApplicationContext from your own machine only, if you like to run this program from other pc/system you can use the http://hello:8080/SomeApplicationContext url ( you can run this url from your own machine also).

I hope this is perfect.


no. Why would that be? Response time depends on servers ability to serve the content -- that is latency in processing teh request and the other is network latency. In your case both are the same. So, no difference.


localhost or hello, both of them must be defined in your hosts file. Your OS looks to hosts file (such as /etc/hosts in many Linuxes or %windir%/system32/drivers/etc in some Windowses) if it cannot find it in there, OS asks a DNS server for server ip.

In your situation, both must be defined in your hosts file. No change in network latency.

But if you mean different domains pointing same IP, then it depends on how your server application (apache, nginx, IIS etc.) handles different domain names.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜