5 ms·
Before everyone jumps onto the JQuery/Bootstrap/etc sucks bandwagon, just a reminder that the minified jquery from cdnjs is 84.1kb. Bootstrap is 43.1kb. If you
by robotnoises 10y ago
Before everyone jumps onto the JQuery/Bootstrap/etc sucks bandwagon, just a reminder that the minified jquery from cdnjs is 84.1kb. Bootstrap is 43.1kb.
If you want your page to load fast, the overall "size" of the page shouldn't be at the top of your list of concerns. Try reducing the # of requests, first. Combine and minify your javascript, use image sprites, etc.
- madawan 10y agoor use HTTP2 which should make the number of requests largely irrelevant.
- acdha 10y agoHTTP/2 helps with that but the total size still matters. This is particularly relevant for resources like CSS which block rendering – even with HTTP/2 making it less important whether that's one big resource or a dozen small ones, the page won't render until it's all been transferred. https://github.com/filamentgroup/loadCSS#recommended-usage-pattern https://github.com/filamentgroup/loadCSS#recommended-usage-p... has a rather nice way to load CSS asynchronously in browsers which support rel=preload.
- spiderfarmer 10y agoI see lots of websites that don't even cache static resources and use > 10 scripts and stylesheets, from a lot of different domains. Terrible.
- eterm 10y agoAnd link the non-minified versions. (but the different domains actually helps speed up loading with http because it helps parallelise transfers.)
- spiderfarmer 10y agoDomain sharding almost never makes any sense, especially on mobile, and with HTTP2 it's working against you. http://www.mobify.com/blog/domain-sharding-bad-news-mobile-performance/ http://www.mobify.com/blog/domain-sharding-bad-news-mobile-p...
- r1ch 10y agoThat's still 84 KB of highly compressed javascript code to parse and execute. Even on a 4.4 GHz CPU core and a cached request, jquery takes upwards of 22ms to parse - that's just parsing - not even executing anything! Now add a bunch of other frameworks and utility scripts and your 100ms budget for feeling "fast" is gone before you even reach the HTML content.
- robotnoises 10y agoThat's a fair point, though my threshold for fast is probably a bit higher than 100ms. That might be a conditioned thing, though.
- adrianN 10y agoIt's not much higher than 100ms https://www.nngroup.com/articles/response-times-3-important-limits/ https://www.nngroup.com/articles/response-times-3-important-...
- dclowd9901 10y agoHow long does it take you to start Word versus loading Google docs? Has everyone gone insane? The web is absolutely incredible and JavaScript is absolutely killing it as a portable application language. Remember the dark days of flash? Stop complaining.
- supergauntlet 10y agoThis is disingenuous - he's obviously referring to image and text articles, not complicated web apps. Obviously such a website is going to take longer to load, just as complex native applications take a while to load. But to claim that because Word takes a while that it's okay that A WEBSITE WITH LITERALLY JUST TEXT AND IMAGES is 18 megs big and takes 6000 ms to load is fucking stupid.
- TeMPOraL 10y agoAlso, Word takes a while to load, but then works fast and is responsive - as well-written native apps are by default - and doesn't suck up your system resources. Something which can't be said about many websites "with literally just text and images".
- tedmiston 10y agoNot to mention that using the latest stable jQuery/Bootstrap from CDN means it's likely to be cached before a user visits your site.