Thursday, May 4th, 2006
From the O’Reilly XML.com site today, there’s a new article that looks at the caching of Ajax requests (and the data they provide).
Making HTTP requests willy-nilly from AJAX applications, however, is almost never a good idea or design decision. The server side of the equation may not be able to handle the flood of requests. The client side of the AJAX application may have some of its requests time out or abort, which will disrupt the user experience that is meant to be AJAX’s strength.
They give the example of grabbing the latest energy prices from the U.S. Energy Information Agency and displaying them in a section of your site. Of course, you could make the request for the information each time, but depending on your connection and how popular the site is, there is a better way to handle it.
They give the example of caching based on a time limit first, complete with the code to grab the information, set up the refresh capability, and create the cache for the script to check later on. Of course, grabbing the information across from another domain requests a little coding magic, and they chose this kind of proxy to get the job done.
Posted by Chris Cornutt at 12:30 pm