eshellborn
eshellborn

Reputation: 11261

Do external links load slower?

This seems like a really simple question that I would be able to find the answer to super easily, but apparently not.

On a web page, let's say I'm loading an image. Would it take longer for the page to load if I write the link as <img src="http://www.example.com/img/image.jpg"> than if I put it as <img src="/image.jpg">?

The image would be on the same site as the page. The reason I'm asking is because I have a bunch of files that use the external method, and and wondering if it's worth it to change them.

Upvotes: 0

Views: 57

Answers (1)

Quentin
Quentin

Reputation: 943605

You are confusing absolute URLs and external URLs.

Using an absolute URL will cause the HTML document to take longer to load (simply because you have added more characters to its source code). It will not, however, be significantly longer.

The image will not take longer to load. The browser would have to resolve a relative URL into an absolute URL before using it anyway.

Upvotes: 2

Related Questions