I noticed a performance degradation when in my webpages I use the full HTTP URL to load an image.
Let’s say my website is on mydomain.com.
Let’s say images are all in mydomain.com/imgs directory.
It seems it’s slower when I place images in the webpage using the full URL format:
<img src="http://mydomain.com/imgs/someimg.jpg">
rather than doing:
<img src="/imgs/someimg.jpg">
Same issue for loading JavaScript/CSS files.
Is the web server on mydomain.com taking more time to get images/fiels when using full http url (still on mydomain.com) compared to document root paths???
There is no difference. The browser always needs the absolute URL to retrieve the resource. So the relative URL needs to be resolved to an absolute URL. But that is absolutely negligible.