3 ms·
> One is that your page should work without javascript Universal rendering would send straight HTML with inline styles to the browser. And plenty of web applic
by lowboy 11y ago
> One is that your page should work without javascript
Universal rendering would send straight HTML with inline styles to the browser. And plenty of web applications need JS to function properly.
- adrusi 11y agoTrue. Doesn't address the userstylesheet problem though. Also, sending prerendered pages with inline styles causes a bandwidth problem. Your prerendered page is probably dynamic and uncacheable, but your stylesheet isnt. By using inline styles, you send tons of repetitive uncacheable styles over the network where you could have just used a stylesheet. If you need the power that a full general purpose programming language gives you for some of your stylesheet, go ahead and use inline styles where needed, that's why they exist. But there's no reason that you should then decide that all of your styles ought to be inline.
- matchu 11y agoIf they're really that repetitive, then gzip should eliminate almost all of the bloat. We also need to think about number of round-trips. If you're on an old phone on a 3G connection in India, the extra round-trip from requesting the HTML then requesting the CSS makes a difference. I'm super interested about the performance aspect, too, but I feel like we need numbers to really go into detail. There's way too many factors at play here for the correct answer to be obvious.
- yid 11y ago> We also need to think about number of round-trips. If you're on an old phone on a 3G connection in India, the extra round-trip from requesting the HTML then requesting the CSS makes a difference. If your stylesheets are properly versioned, they can be cached forever, which means exactly the same number of requests as inline styles with much less bandwidth use.
- matchu 11y agoNot on first load. The cache needs to be populated somehow. I agree that it's a special case, but it's one we shouldn't just ignore.
- adrusi 11y agoAnd the number of roundtrips can be helped by using Keep-Alive.