I have an website and I want to improve it’s performance. I’ve fixed all common issues but I have two questions:
1) Let’s say I have a 100x100px image and I want to show it. Does this <img src=" test.jpg" height=100" width="100" alt=""> load slower than this <img src=" test.jpg" alt=""> ?
2) Let’s say my domain is http://www.test.com. Do HTTP absolute paths on the same domain load slower than relative paths ?
Is <img src=" http://www.test.com/test.jpg" alt=""> slower than <img src=" test.jpg" alt=""> ?
Thank you !
In both of these cases, the answer depends on the browser implementations. These are some speculations:
The load time shouldn’t change significantly. There may be some extra processing time since the image scaling logic would be triggered, but there would be less time in recomputing the layout, since once the image loads, it won’t affect how much space it occupies.
The relative URL may be slower in case the domain name has to be requeried, but in most cases, the requests will be pipelined, so you shouldn’t see any real differences.