Making the most of Ajax doesn't end with beautiful code: you also need a solid network infrastructure that won't choke when client calls surge. In this special feature just for network admins, Ajax consultant Thomas A. Powell introduces Ajax basics, then offers tips for optimizing, monitoring, and securing Ajax applications on your network.
Also see the related Network World slide show: "What every network pro needs to know about Ajax."
1. Ajax is an idea, not an acronym
XMLHttpRequest object for communications, which is making its way through the World Wide Web Consortium (W3C) process. Because, like many Web technologies, it now is only an ad hoc industry standard, notable differences can be found in various browsers' implementations of it. It's also possible to use other data transport mechanisms -- with and without widespread industry support -- with Ajax applications, including traditional frame and image-cookie methods, as well as the use of binary bridges to Flash or Java.
3. XML is not required
Despite the "x" in the acronym, Ajax does not require XML. The
Of course, it is possible and certainly reasonable to use XML, but it is far from required. Using binary formats for uploading files is not supported yet by the
XMLHttpRequest object, but considering that Flash uses a binary format called Action Message Format, it is likely that similar features will be found in Ajax applications soon enough. You should know which format is being passed around the network, because it isn't always XML. Also, make sure you can analyze the format for performance and security.
4. Plan for an increase in HTTP requests
The most obvious issue for the network administrator supporting Ajax applications is that the architectural programming pattern has changed the network utilization of Web applications from a batch-like, somewhat infrequent response of a few hundred kilobytes, to a more continuous exchange of smaller HTTP responses. This means that network-bound Web and application servers may find themselves even busier than before. What Ajax will do to your server and network utilization certainly will depend on how the application is built -- make sure your developers understand the network impact of their applications.
5. Optimize Ajax requests carefully
Web applications should adhere to the network delivery principle of sending less data, less often. That doesn't mean that this principle is widely followed by developers, however. Fortunately for the network, HTTP compression of Ajax responses can reduce response size and is supported in all modern browsers. Because of dynamic compression's overhead, however, speed may not improve much if responses are indeed relatively small. This means that it would be wise for network administrators to turn on compression on their Web server, but they need to understand that with Ajax applications, their gains won't be as big as with traditional Web applications.
To send data less often, we generally would employ caching. Most Ajax implementations can be openly hostile to caching, however, given certain assumptions made by browsers regarding not re-fetching URLs during the same session. Rather than work with caching, many Ajax developers will work aggressively to defeat caching via the header setting or URL uniqueness.