4 ms·
Large/lots of javascript files can slow down the loading of the page, but that wasn't the real issue people were taking with JS-controlled sites (as I interpret
by emef 16y ago
Large/lots of javascript files can slow down the loading of the page, but that wasn't the real issue people were taking with JS-controlled sites (as I interpreted things).
The real delay cost was from the inevitable redirect to the root of the website. When you visit domain.com/user-name, a JS-controlled site will usually redirect you to domain.com#!/user-name, and then loading up the page. There is no avoiding this unless you want really ugly urls: domain.com/user-name#!/user-name...
So large JS files might increase the load speed slightly, but adding an entire redirect is the kicker.
Like most things, there's a time and a place. Using hashbang urls can increase response-time when navigating through a site and provide a really cool experience. On the other hand, it definitely doesn't work for all browsers and users.
- btipling 16y agoSuch a redirect isn't slow? It's near instant if done right. Here's twitter doing it: http://twitter.com/bjorntipling http://twitter.com/bjorntipling It's absolutely super fast for me. How is that a 'kicker'? Large JS files only need to be downloaded once and are cached. There's no problem here.
- emef 16y ago> Such a redirect isn't slow? It's near instant if done right. Here's twitter doing it: http://twitter.com/bjorntipling http://twitter.com/bjorntipling On slower devices (such as mobile phones) redirecting can be more noticeable. You're right though, in general it's not really a problem, but might be more so than a larger-than-normal JS file. > Large JS files only need to be downloaded once and are cached. Yeah, I was trying to say that. Larger JS files aren't a problem at all; load them once and they're cached.