Live data from Hacker News

Preload, prefetch and other link tags

3perf.com

21–28 of 28 posts

Re: Preload, prefetch and other link tags

#21

Earlier quoted context omitted.

I do it because it feels right and logical. If something has a start, it should have an end. If you’re making a that is only going to be used as a spacer with styling, you wouldn’t just do a and leave it hanging.

You are talking about closing tags. I'm talking about self closing tags. One should never use an element as a spacer tag. That's 1990s styling at best.

You are talking about closing tags. I'm talking about self closing tags.

I am, too. My point is that in my mind it feels right to close all tags, either with a closing tag or self-closing it with a /.

One should never use an element as a spacer tag.

One should never use “never” in programming. You are incapable of knowing every possible circumstance someone else is working in.

That's 1990s styling at best.

I built and sold several web sites in the 90’s. That’s not how it was done. It was worse.

Re: Preload, prefetch and other link tags

#22

Random question: for the preconnect, is there some Javascript API now that allows for the monitoring of the TLS handshake? As specified in the article, the handshake is: TLS handshake (only for HTTPS sites). Perform two roundtrips (a message goes client → server → client → server → client) to initiate a secure TLS session Is there any part of that which could be used to send a custom message to the client? A short bi…

Sure, both the ClientHello and ServerHello (which are the first two messages during setup) can contain arbitrary extension fields; these are already used for things like SNI, ALPN, "early data" (optimistic 0-RTT data), and so on. You could define an extension in the private-use range for your esoteric use.

I don't think there's any way to see this from Javscript, though. At least, not web-browser Javascript.

Re: Preload, prefetch and other link tags

#23

Earlier quoted context omitted.

HTML doesn't require a closing slash, but without it needs to be context-aware and maintain a whitelist of tags that are self closing (one effect of this is that custom elements can never be self closing). It's not really surprising that a developer would gravitate towards an encoding that is not dependent on maintaining a whitelist of tags, because that is the solution that intuitively feels more "correct".

If one needs a closing slash to be reminded which of the five or so tags are self closing, one has far more issues than needing a closing slash.

Issues like being a parser?

Re: Preload, prefetch and other link tags

#24

Earlier quoted context omitted.

HTML doesn't require a closing slash, but without it needs to be context-aware and maintain a whitelist of tags that are self closing (one effect of this is that custom elements can never be self closing). It's not really surprising that a developer would gravitate towards an encoding that is not dependent on maintaining a whitelist of tags, because that is the solution that intuitively feels more "correct".

If one needs a closing slash to be reminded which of the five or so tags are self closing, one has far more issues than needing a closing slash.

My point is that not that remembering things is hard, it's that it feels like a hack. Developers gravitate to solutions that feel elegant.

Re: Preload, prefetch and other link tags

#25

Earlier quoted context omitted.

If one needs a closing slash to be reminded which of the five or so tags are self closing, one has far more issues than needing a closing slash.

My point is that not that remembering things is hard, it's that it feels like a hack. Developers gravitate to solutions that feel elegant.

Putting the slash in, as I said, is there for backwards compatibility only, not elegance, and it could be removed at any time since this backwards compatibility issue no longer exists, or is of minor consequence nowadays.

It is far, far better to read and follow the standard specification and not follow a whim that makes you feel good. These are the things that will burn you first.

Re: Preload, prefetch and other link tags

#26

Earlier quoted context omitted.

You are talking about closing tags. I'm talking about self closing tags. One should never use an element as a spacer tag. That's 1990s styling at best.

You are talking about closing tags. I'm talking about self closing tags. I am, too. My point is that in my mind it feels right to close all tags, either with a closing tag or self-closing it with a /. One should never use an element as a spacer tag. One should never use “never” in programming. You are incapable of knowing every possible circumstance someone else is working in. That's 1990s styling at best. I built an…

You are putting the slash in because it feels good but the specification does not do that. You are playing with fire.

Despite your circumstance, the reason for spacer divs, and other such things, are relics of the past and such reasons no longer exist. Using them now is beyond silly.

Re: Preload, prefetch and other link tags

#27
post #11

Just because I can... I find it interesting that he is inconsistent in his usage of . Some of his markup has a closing slash and some of it doesn't. However, my main gripe, is that the HTML spec has never specified or required a closing slash. While it is allowed, putting that slash there has no meaning, it does nothing, and the spec tells browsers they are to ignore for those reasons. When I ask why some people insi…

Some template engines require well-formed XML (like Thymeleaf, in certain configurations)

And that is XML, not HTML, and never the twain shall meet.

The hilarity of your statement is all the disdain people had for XML and the W3C's push for its usage over HTML. Now everyone praises WHATWG for breaking away from the W3C over this and, here we are, with XML lookalikes and XML usage everywhere.

Re: Preload, prefetch and other link tags

#28

Just because I can... I find it interesting that he is inconsistent in his usage of . Some of his markup has a closing slash and some of it doesn't. However, my main gripe, is that the HTML spec has never specified or required a closing slash. While it is allowed, putting that slash there has no meaning, it does nothing, and the spec tells browsers they are to ignore for those reasons. When I ask why some people insi…

personally, I don't care one way or the other, so I always leave them whichever was my most recently used linter/IDE's default preference & basically ignore it beyond that

the spec says to ignore it either way & I think my way aligns w/ that (while being nearly optimal in terms of effort efficiency)

Post reply on HN