Live data from Hacker News

Preload, prefetch and other link tags

3perf.com

11–20 of 28 posts

Re: Preload, prefetch and other link tags

#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)

Re: Preload, prefetch and other link tags

#12

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…

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".

Re: Preload, prefetch and other link tags

#13

I'm not sure where the submitted title came from; it's not the title on the article, and it's factually incorrect -- there's only one tag (LINK), which includes an attribute (REL) that can be set five different ways. That's a lot cleaner and more orderly than "5 different tags to preload something" suggests.

We've replaced the title with that of the article. (Submitted title was "HTML has 5 different tags to preload something. Here’s a deep-dive into all".)

Re: Preload, prefetch and other link tags

#14

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…

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.

Re: Preload, prefetch and other link tags

#15

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…

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".

Completely agree. If you want a generic parser for HTML-like tags, templates or anything where the context isn't a full HTML page, you definitely want syntactically correct/valid markup.

Re: Preload, prefetch and other link tags

#16

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…

[deleted]

Re: Preload, prefetch and other link tags

#17
It's unfortunate that Chrome's definition of 'mandatory' is flexible in a bad way. If you've done enough performance profiling of webapps in Chrome you may have noticed that even cached resources can take over 20ms to load from cache - this is because all cache loads have to go between processes, so they get delayed until thread/process switches can happen and messages can get ferried back and forth. If you're unlucky, you eat this delay on every resource you load. In some cases this can add over a second to load time for an application.

You might think 'well this calls for prefetch, right? load them all at once'. You're right! Except it doesn't work. Chrome content processes ignore prefetch directives, all they seem to do is ensure that they're in cache - so there's no way to avoid eating this 20+ms hit per-resource.

Ideally you control all the code being run in your app so you can just issue the relevant XHR requests to load everything up-front and not block on those requests, but I've frequently run into cases where a downloaded resource loads other resources, etc. Really frustrating that caching and prefetch are so slow in Chrome and there's no indication that they will fix it.

It's my understanding that in comparison Safari does not have this hit per-asset, loading the applications I've tested is dramatically faster on an iPhone compared to Chrome on a desktop PC. :(

Re: Preload, prefetch and other link tags

#18

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…

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".

Too bad the closing slash doesn't do anything. will break horribly if you try to use it. Everything still depends on the whitelist.

Re: Preload, prefetch and other link tags

#19

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…

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.

Re: Preload, prefetch and other link tags

#20

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…

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.

Post reply on HN