Chapter 7. Ajax: Avoiding the traffic

image with no caption

People want the best experiences out of life... and their apps. No matter how good you are at Rails, there are times when traditional web apps just don’t cut it. Sometimes users want something that’s more dynamic and that responds to their every whim. Ajax allows you to build fast, responsive web apps, designed to give your users the best experience the web has to offer, and Rails comes complete with its own set of Ajax libraries just waiting for you to use. It’s time to quickly and easily add Ajax goodness to your web app and please even more users than before.

There’s a new offer at Coconut Airways

Coconut Airways has introduced a new promotional offer: the last three seats on every flight are on sale at half price!

But there’s a problem. Obviously, everyone wants to grab the final three seats, and so in the last hour or two before the check-in closes, customers are continually hitting the reload buttons on their browser, in the hope of getting a cheap flight. Unfortunately, the increase in traffic is putting enormous pressure on the Coconut Airways server.

image with no caption

The extra requests are causing the Coconut Airways site to slow down. There are so many people requesting info on the flights that are close to departure, that other users are having problems getting ...

Get Head First Rails now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.