6 ms·
Friendly reminder for people on HN reading this: I know this is actually quite interesting, but before you start worrying about the latency of the name servers
by st_goliath 7y ago
Friendly reminder for people on HN reading this:
I know this is actually quite interesting, but before you start worrying about the latency of the name servers of your TLD, you might want to do something about the metric ton of JavaScript on your site and the 25 different 3rd party servers from which you side load most of it. Also those 6 additional servers from which you load a bunch of TTF fonts. Especially if all your site does is just display some text and two or three pictures.
- RL_Quine 7y agoNo kidding. I'm using a > 1GBit fibre line and the majority of my page loads is still downloading recursive, pointless javascript dependencies, or doing a billion CORS OPTIONS requests and waiting for the response. DNS latency doesn't even factor into the end result user experience, it's dominated entirely by front end design decisions. If this was a concern it’s an admission that JavaScript developers have optimized to the best of their ability. Which is just sad.
- tgv 7y agoDo you have a moment to talk about The Great Saver, uMatrix?
- RL_Quine 7y agoDisabling a lot of the bloat makes random pages break, which is an even worse experience.
- jerf 7y agoBut it is compensated for by the sites that actually work better when you strip their non-local JS from them. I've lost track of the number of times I've come to the HN comments and read about how unreadable the page was due to all the popups and ads and modal dialogs when I just read the text. You're absolutely not wrong that some sites get worse, but it's not one-sided in that direction.
- swinglock 7y agouBlock Origin is probably the better middle way for most. It should accomplish what you describe most of the time yet breakage is the exception instead of the rule.
- gsich 7y agoThose random pages are not worth the visit then.
- pmontra 7y agoWould I recommend uMatrix to my non technical friends? Absolutely not. For technical people it's a matter of self selection. It's worse for the ones of us that can't bother checking which scripts break the page and deciding whether to enable them. It's great for the others. Personally I can't imagine using the web without uMatrix (and uBlock Origin). For the site that really breaks no matter what, if I really need it either I open it in a Vivaldi private window (I only have uBlock in that browser) or if anything else fails, I start Chrome and close it immediately after I did what I had to do.
- Tsarbomb 7y agoNothing wrong with preflight checks. What’s wrong is that a SPA will make 100 calls to a web server for data that isn’t even that complex. So much poor API design out there that most would be better off with server side rendering.
- dragonwriter 7y ago> So much poor API design out there that most would be better off ...fixing the API design.
- blowski 7y agoMany inexperienced developers don't understand the difference in latency between a local memory call and a remote HTTP API call, so treat the two as equal in terms of architectural concerns.
- pmlnr 7y ago> a billion CORS OPTIONS requests When I first saw the CORS headers on large sites that are sent with every effin request, I thought I gone mad, only to learn that it's encouraged to be used... I remember times with monsteriusly sized cookies, this is the same, except this won't go away with the rise of server side sessions.
- rhizome 7y agoIt's been a truism for many years now: "slow" is often not your side of the pipe, especially with high-bandwidth connections. >If this was a concern it’s an admission that JavaScript developers have optimized to the best of their ability. Which is just sad. I mean sure, but "is this the best you can do?" requires you to know what the goals are, and I suspect the issues raised in these comments are not on hardly any of the lists. New Relic and its third-party cool-usage-graphing friends are way way higher in priority.
- social_quotient 7y agoAre you suggesting this might be a premature optimization? :)
- arminiusreturns 7y agoTo 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.
- aloknnikhil 7y agoAbsolutely agree with this. The first time I installed the uMatrix extension, half the sites were broken because they wouldn't load unless I greenlighted access to all the third-party servers. Only 30% of the sites I've come across didn't need tinkering with uMatrix to work. PS: uMatrix disables loading of resources (IFrames, scripts, etc.) if it's not served by the first-party (i.e. The domain itself) domain by default.
- jlgaddis 7y agoAnd if they weren't using 60 second TTLs everywhere, they might actually from the caching built into DNS!