BT

Rails 4 Released: Faster Pages With Turbolinks

by Mirko Stocker on Jun 28, 2013 |

The Ruby on Rails team has just released Rails 4.0. One and a half years in the making, Rails 4 comes with some interesting new features like Turbolinks, improved caching and is thread-safe by default. Many of the changes are already used by 37 Signals' Basecamp Next.

Turbolinks transforms your Rails application into a single page JavaScript application, that is, it does not load new pages but instead replaces the current page with new content from the server: 

This is similar to pjax, but instead of worrying about what element on the page to replace, and tailoring the server-side response to fit, we replace the entire body. This means that you get the bulk of the speed benefits from pjax (no recompiling of the JavaScript or CSS) without having to tailor the server-side response.

Rails 4 also comes with support for key-based cache expiration, which automates cache invalidation and thus makes it easier to implement intricate caching structures.

The release also dropped support for Ruby 1.8 and recommends to upgrade to Ruby 2. Ruby 1.9 is still supported, but Rails 5 will require at least Ruby 2. As usual, there's a detailled upgrade guide for Rails 3.2 applications to Rails 4.

Popular Rails books have also received an update: Agile Web Development with Rails 4 by Sam Ruby and The Rails 4 Way by former InfoQ editor Obie Fernandez.

For a more detailed list of changes, see the changelog. Have you already upgraded your application to Rails 4? We'd love to hear about your experience!

Hello stranger!

You need to Register an InfoQ account or to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

rails by Tom Tom

somehow rails almost always addresses the most popular issues I have in developing web apps... fantastic work!!

Re: rails by Jamal Soueidan

Of course RubyonRails is a great framework for most web apps! and the community around it is even better :D

Re: rails by Mirko Stocker

So, have you upgraded your applications already?

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

3 Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2013 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT