: PageSpeed - Minimize DNS lookups: why not use IP address for resources One of the recommendations from web performance optimization services is to minimize DNS look ups. I fully understand why
One of the recommendations from web performance optimization services is to minimize DNS look ups.
I fully understand why they recommend this but why not just point references to external files to the IP address?
For example:
<script src="//555.555.55.55/cdn/jquery.min.js"></script>
I have never seen this done, and my searches here came up empty, why not?
More posts by @Murphy175
1 Comments
Sorted by latest first Latest Oldest Best
Just to clarify the question to prevent confusion: It's advised by Google to reduce the number of lookups for unique hostnames - see: Minimize DNS lookups
As indicated there, hostnames are cached in the client's browser and OS. Using an IP address instead of a hostname for files hosted on the same host would therefore not be of benefit.
For files hosted elsewhere, you shouldn't use an IP address because they can change, whereas hostnames will not. For files hosted on a CDN like jQuery, a range of IP addresses will most certainly be used for redundancy, load balancing, etc... Reaching a busy server or incorrect IP address would result in any code running the library to no longer function.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.