5 ms·
To add to this, one thing people tend to forget is that html has a dns prefetch option for offsite js you absolutely must have. (rel=dns-prefetch) Of course I
by arminiusreturns 7y ago
To add to this, one thing people tend to forget is that html has a dns prefetch option for offsite js you absolutely must have. (rel=dns-prefetch)
Of course I agree with goliath, which is why I try very hard to write pure html5+css3 with no JS unless absolutely necessary. It is very rarely necessary. When it is, very rarely do I need one of the crazy frameworks, pure js works pretty well.
Beyond that, this is why adblocker plus and umatrix are two must have addons to firefox. Once you build your asset rule list up with only the couple of js needed to run a site, the same site that takes forever for the average visitor can actually be fairly speedy when none of it's js loads.
Now, for original topic, if you are on windows check out GRC's DNS Benchmark, and if on nix, check out namebench.
- brianzelip 7y agoThanks for the tip. I've heard about it, but never saw anything about it. Here is a bit of info on dsn-prefetch, https://developer.mozilla.org/en-US/docs/Web/HTTP/Link_prefetching_FAQ https://developer.mozilla.org/en-US/docs/Web/HTTP/Link_prefe...
- arthurcolle 7y ago> rel=dns-prefetch This is amazing! How could I have missed this? How are the loading times affected when using this option, if you care to share?
- Ayesh 7y agoIt largerly depends on how you use it. For example, if you are using standard Google Fonts, you can pre-connect to the fonts file's hostname so the browser already has DNS resolved when the CSS file refers to the font files.
- arminiusreturns 7y agoIt helps more when the offsites are in another geographic location, like if for some reason you are loading something from the EU on a server in the US. Benefits can be marginal otherwise, so I just suggest people play around with it for any offsite requests they have.
- 3xblah 7y agoBeware even some text-only browsers have added prefetching; need to patch source to turn it off And then there are browsers that have internal stub resolver. Horrible https://www.reddit.com/r/chrome/comments/bgh8th/chrome_73_disable_chromes_internal_dns_client/ https://www.reddit.com/r/chrome/comments/bgh8th/chrome_73_di... https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-DNS-Prefetch-Control https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-... https://www.chromium.org/developers/design-documents/dns-prefetching https://www.chromium.org/developers/design-documents/dns-pre... https://www.ghacks.net/2019/04/23/missing-chromes-use-a-prediction-service-setting/ https://www.ghacks.net/2019/04/23/missing-chromes-use-a-pred... https://www.ghacks.net/2013/04/27/firefox-prefetching-what-you-need-to-know/ https://www.ghacks.net/2013/04/27/firefox-prefetching-what-y... https://www.ghacks.net/2010/04/16/google-chrome-dns-fetching/ https://www.ghacks.net/2010/04/16/google-chrome-dns-fetching... I have been doing "DNS prefetching" before this term existed I do non-recursive lookups and store the data I need in custom zone files or HOST file. I get faster lookups than any "solution" from any third party. It is sad how much control is taken from the user, always with the stated goal of "making the web faster". In many cases they are makng it slower. The irony of this blog post by a CDN about TLD latency is that some CDNs actually cause DNS-related delay by requiring excessive numbers of queries to resolve names, e.g., Akamai Users have the option to choose for themselves the IP address they want to use for a given resource. If they find that the connection is slow, then they can switch to another one. Same idea as choosing a mirror when downloading open source software. Some users might want this selection done for them automatically, others might not
- wahern 7y ago> And then there are browsers that have internal stub resolver. You mean internal caching resolver? Every application has an internal stub resolver, even if it's just using getaddrinfo, which builds and sends DNS packets to the recursive, caching resolvers specified by /etc/resolv.conf or equivalent system setting. But getaddrinfo is blocking, and various non-portable extensions (e.g. glibc getaddrinfo_a, OpenBSD getaddrinfo_async) are integration headaches, so it's common for many applications to include their own async stub resolver. What sucks is if an internal stub resolver doesn't obey the system settings.
- Ayesh 7y agoYou can go ahead a step and `preconnect` to a particular URL if you know it. This includes dns prefetching but goes ahead and initializes an HTTP connection.