Search code examples
htmlhyperlinkhref

HTML <a> link tag different styles speed


Let's say i have a certain file file.php
What i want to know is : is there any loading speed between the following or is it the same :

<a href="http://mywebsite.com/file.php">File</a> 
<a href="./file.php">File</a> 
<a href="file.php">File</a> 
<a href="/file">File</a> <!--rewrite rule-->

Solution

  • Some URLs have (obviously) more bytes than others, so it will take longer to send them over the network in the first place. This will not be a significant difference.

    Browsers will resolve URLs at the same speed.

    Rewrite rules require extra processing, so requests involving them will take longer. Again, this will not be a significant difference.


    You appear to be embarking down a road of premature optimization.

    Don't do that.