5 ms·
I like this article a lot, it makes a good point that many of us often overlook. What's the dominant feeling about ajax to reduce page weight? It is ok if my
by habosa 14y ago
I like this article a lot, it makes a good point that many of us often overlook. What's the dominant feeling about ajax to reduce page weight? It is ok if my page is 1MB but only the initial 100KB are sent synchronously and necessary for interaction? An example would be YouTube sending just the main page layout and video player and then async loading all of the related stuff and comments.
- chubot 14y agoIt seems in theory that it should work. In practice the AJAX I've seen makes the perceived experience worse. There was a thread about Github latency a few months ago, and they use AJAX heavily in the source browser to hide latency, but it just seems janky to me. I would be interested to hear if anybody is using AJAX to make very light sites that are accessible in Siberia and the places mentioned in this article. I can't really think of one. I'm sure it's possible though. FWIW this is why craigslist is universally popular. Because you can use their site from the public library with IE5 from a dialup connection! When you're trying to overcome the chicken and egg problem of community sites, that extra population is probably pretty important.
- danenania 14y agoIt can help, but still has to be applied carefully. A fast initial load is pointless if a bunch of widgets are making the page jerk and jump all over the place for the next 30 seconds. The strategy I've used is to serve up a light frame with the meat of the content, while keeping all ajax/external site dependent stuff hidden (with equivalently sized placeholders to avoid shifting layout and scroll), then doing a single subtle fadein of the additional content when everything's ready. You can tweak the timing--like if you have a few bits of ajax content from your server that take 1-2s to load, and a few social buttons that are taking more like 5-6s, you'd probably want to fade those in separately in two steps. The point is to carefully orchestrate how elements appear to the user, not just bombard them with everything at once.
- lincolnbryant 14y agoPeople are not taking into account "browser crunch" of parsing and executing all of this javascript required to defer loading to ajax. This is painful to phones, but heavyweight frameworks like jQuery mobile are still used, even though we know just parsing jQuery can take phone several seconds. It could be quite a while before your $.ajaxes will fire.
- zacman85 14y agoI really like only using AJAX for content that is conditional. For instance, a comment form that opens up only when a user clicks on it. If they never go to add a comment, the AJAX request is never made. Anything that is actually going to be displayed immediately on the page should be loaded as soon as possible as there are major performance gains in letting the preprocessors do their work properly.
- rorrr 14y agoIt helps a lot, assuming the user can use most of the page while you ajax-load the less important stuff. Perceived speed is extremely important. http://www.nytimes.com/2012/03/01/technology/impatient-web-users-flee-slow-loading-sites.html http://www.nytimes.com/2012/03/01/technology/impatient-web-u...