O'Reilly logo

Rails 3 in Action by Yehuda Katz, Ryan Bigg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 16. Basic performance enhancements

This chapter covers

  • Implementing pagination for resources with the Kaminari gem
  • Improving database query speeds with Active Record features
  • Caching pages and fragments of pages
  • Using the Delayed Job gem with background workers

When an application is written, it may be done in such a way that it will not perform ideally. A common situation is that an application with a small database will perform quickly because there is less data to retrieve, but starts to slow as the database grows larger. This problem can be fixed in many different ways.

The first way is to limit the amount of data retrieved in any one call to a fixed limit, a process known as pagination. At the moment, for example, you’re not ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required