Re:How we improved our website's performance
by lwansbrough on Sunday January 24, 2021 @03:20PM
(#25895512)
It certainly feels that way sometimes. But web is rather unique. There aren't any other platforms that demand you deliver an application for "a device" (specifications unknown!) in under 1 second.
[ Parent
| on HN ]
Re:How we improved our website's performance
by giantrobot on Sunday January 24, 2021 @04:11PM
(#25896088)
That's why there's all kinds of helpful features in HTML/CSS like media queries. You can serve up raw content and let the device make decisions on what resources to use to display the content. You can tell the device the most optimal resources for its particular constraints.
As a for instance you your script tag can just include a bunch of @import statements. Thankfully @import statements support media queries [0]. So you get the utility of external style sheets but can load one optimized for the client device. Unlike media queries on link tags the browser doesn't load style sheets (well they're not supposed to) that don't match the media queries.
It's also trivial to include a tiny bit of base styling with every page in a script tag. It doesn't blow any size budgets and makes sure a page is readable even with no external assets.
[0] https://developer.mozilla.org/en-US/docs/Web/CSS/@import
Re:How we improved our website's performance
by majewsky on Sunday January 24, 2021 @03:51PM
(#25895872)
Web is indeed unique. No one else would consider a magazine article "an application".
Re:How we improved our website's performance
by Frost1x on Sunday January 24, 2021 @04:09PM
(#25896074)
There's such a thing as an unreasonable, unrealistic, or downright stupid demand as well. What you often see is a house of cards hacked together to try and support such demands on the web.
Sending reasonably well visually formated text is definitely a reasonable demand though.