
« August 2007 | Main | October 2007 »
People ask whether these performance rules apply to Web 2.0 applications. They definitely do! This rule is the first rule that resulted from working with Web 2.0 applications at Yahoo!.
One of the cited benefits of Ajax is that it provides instantaneous feedback to the user because it requests information asynchronously from the backend web server. However, using Ajax is no guarantee that the user won't be twiddling his thumbs waiting for those asynchronous JavaScript and XML responses to return. In many applications, whether or not the user is kept waiting depends on how Ajax is used. For example, in a web-based email client the user will be kept waiting for the results of an Ajax request to find all the email messages that match their search criteria. It's important to remember that "asynchronous" does not imply "instantaneous".
To improve performance, it's important to optimize these Ajax responses. The most important way to improve the performance of Ajax is to make the responses cacheable, as discussed in Rule 3: Add an Expires Header. Some of the other rules also apply to Ajax:
However, Rule 3 is the most important for speeding up the user experience. Let's look at an example. A Web 2.0 email client might use Ajax to download the user's address book for autocompletion. If the user hasn't modified her address book since the last time she used the email web app, the previous address book response could be read from cache if that Ajax response was made cacheable with a future Expires header. The browser must be informed when to use a previously cached address book response versus requesting a new one. This could be done by adding a timestamp to the address book Ajax URL indicating the last time the user modified her address book, for example, &t=1190241612. If the address book hasn't been modified since the last download, the timestamp will be the same and the address book will be read from the browser's cache eliminating an extra HTTP roundtrip. If the user has modified her address book, the timestamp ensures the new URL doesn't match the cached response, and the browser will request the updated address book entries.
Even though your Ajax responses are created dynamically, and might only be applicable to a single user, they can still be cached. Doing so will make your Web 2.0 apps faster.
Steve Souders
[Steve Souders is Yahoo!'s Chief Performance Yahoo!. This is one in a series of Best Practices for Speeding Up Your Web Site. This article is based on Steve's book High Performance Web Sites, published by O'Reilly.]
Posted by stevesouders at 8:51 AM | Comments (14)
A minor update to the Yahoo! Search SDK went live today. Included are various minor bug fixes and improvements to the Widgets, Python, Perl, Flash, Java and PHP examples. You can download it here. Props to all our SDK authors who are mentioned in previous posts.
Posted by at 7:22 AM | Comments (0)
You've probably seen the big warning notices on the documentation already, so consider this a final reminder... The Yahoo! Photos API will become unsupported on September 20th (today), the date when Yahoo! Photos is set to close.
"Unsupported" means that the API calls may continue to work as long as the Photos back-end systems are still powered on and able to speak to the world. But we will not be monitoring them or offering help or advice on working with them.
While we're talking photos, many Yahoo! Photos users have been moving their photos to Flickr. So we encourage you to have a look at the Flickr APIs for all your future photo mashup and application needs. You'll be in good company.
Jeremy Zawodny
Yahoo! Developer Network
Posted by jzawodn at 7:00 AM | Comments (1)
That's right. The famous (or infamous?) Open Hack Day is continuing it's trek around the world, stopping in Bangalore, India on October 5th and 6th.
We were struck by lightning twice at Hack Day in London, and now we're back for more. We're pleased to announce that we plan to hold another open Hack Day in Bangalore on October 5th and 6th, 2007.
We'll be inviting 200 developers to attend the event, which will begin with hack-related presentations from some of the Web's most respected developers. We will then dive into 24 hours of hacking on a very nice collection of tools, APIs, and data, and end with awards from the sponsors plus bragging rights until the end of eternity or the next Hack Day, whichever comes first.
The Hackday.org site has all the details, of course.
BTW, I happen to have an insider tell me that they're going to have good wireless and a 20Mb/sec link to the Intertubes!
Jeremy Zawodny
Yahoo! Developer Network
Posted by jzawodn at 10:45 AM | Comments (1)
We now have a code example that uses the JAX-WS library for our Java developers that use the Yahoo! Mail API. Yahoo's own Sam Pullara who's "not a big fan" of Java's Axis2 library, decided to write a Mail API hack using JAX-WS. Read all all about it on his blog. You can now download both the Axis2 and JAX-WS examples from our Yahoo! Mail code page.
Posted by at 11:02 AM | Comments (2)
Ever looked at YUI's richness and had thoughts like "This looks really cool, but I just want to try something out." or "I wish there was a way to get something working fast." Enter Yahoo's own Bill Scott, with Protoscript. Protoscript quickly brings static pages to life, by connecting HTML elements to behaviors and events with a minimum of fuss.
From the author:
"The goal of Protoscript is not just to provide a library for prototyping rich interactions. The main purpose is to build simple yet rich tools on top of the library to make it easier for designers, product managers, business owners and all the non-techies to experiment with different interaction techniques--without coding."
The site is stuffed full of working examples--so far there are 31 flavors, with an open wiki for contributions--plus a handy bookmarklet that should allow you to try Protoscript on any site you can load into your browser.
Here's a sample from the Demos section. It waits for the user to click on the element identifed as avatar, fades it, and hides it from the browser:
$proto('#avatar', {
Click: {
onClick: {
Fade: {
opacity: {to: 0},
onComplete: {Close : {} }
}
}
}
});
The code itself is a JSON object, funneling user activity through event listeners and behavior wrappers. Anyone who's ever tried to write an event listener from scratch will testify that there's a lot going on here, but it's handled by the YUI, jQuery, and Protoscript libraries, saving much developer time and heartache.
Kent Brewster, Yahoo! Developer Network
Posted by Kent Brewster at 10:04 AM | Comments (1)
Copyright © 2008 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Copyright Policy - Job Openings