3

I have a server and I'm using it as web server, I have a web site hosted in it
In a web browser when I access it using the IP address the site loads very slow, but when I access it using Domain Name (mysite.com) it loads normally
Why the site loads normally while using domain name and very slow while using IP address?

Note: I'm using windows server 2008 R2, IIS7

1
  • 1
    same problem. Any solutions? May 2, 2012 at 21:00

1 Answer 1

2

The Host HTTP header is different so you should check what is the default virtual host on your server and try to figure it out why it slow. Also without precise measures what takes long you won't be able to even just ask the right question. Try to figure out precisely what is slow with some tool like this.

http://developer.yahoo.com/yslow/ http://www.websitepulse.com/ http://www.pingdom.com/services/

2
  • I mean slow it takes 2-3 minutes to load the homepage, I checked with pingdom and it showed the site loads in one second, it seems in my region the site loads slow with IP address, you said the host HTTP header differs and I should check more with virtual host, sorry but I didn't understand what you meant can you please give me more explanation or a link to clarify it to me (I checked google but no luck)
    – Kronass
    Dec 26, 2010 at 10:04
  • Sure, no problem. So when you hit a website with you browser it sends some data to the server called HTTP request header. You can check this URL: en.wikipedia.org/wiki/List_of_HTTP_header_fields So one of these is the "Host" field which tells to the webserver which virtual host to serve. Imagine you have www.yourdomain.com and www.alsoyours.com on your server and both points to the same IP. So the web server must know which one to serve and the decision is based on that field. Hope it helps.
    – Istvan
    Dec 26, 2010 at 13:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .