3 ms·
(Disclaimer: I'm not a coder, so I easily get overwhelmed by what others might see as very simple) It may be better for delivery, but the second example is unr
by NetStrikeForce 11y ago
(Disclaimer: I'm not a coder, so I easily get overwhelmed by what others might see as very simple)
It may be better for delivery, but the second example is unreadable compared to the clean one. I can see why it's much better to add 15KB to your HTML file than having to request those 15KB from a separate file (one or two full round-trips of added latency :)).
- bleachedsleet 11y agoWhile you're correct in observing that the first example is shorter and potentially easier to read at a glance, there is a method to the madness in the second. They inlined the CSS needed for content above the fold which speeds up load times theoretically. They then use JS to load the rest of the CSS later on so they can control exactly when the stylesheet is loaded...just linking like one would normally do would negate the perceived benefit. The end result should be comparable overall load times but the end user should perceive a slight decrease since important information is styled immediately. So yeah, the second is a little more confusing and in this case is drastic overkill, but their point still stands.