Make Rails app’s page loads
faster with Wiselinks
Vu Ngoc Anh
What’s Wiselinks
• Is a gem likes Turbolinks to make page loads
faster by using AJAX and history APIs as
pushState to repl...
The difference with Turbolinks
• Wiselinks work as a whitelist when Turbolinks
work as blacklist
• Processes 30x http redi...
Installation
• Add “ gem ‘wiselinks’ ” to Gemfile then
bundle
• Add “//= require wiselinks” and create
wiselinks object “w...
Demo
Notes
• Use ‘wiselinks_title’ helper to set title of page
• Problem when using ‘document.ready’
• Event: ‘page:loading’, ‘...
Thank you
• https://github.com/igor-alexandrov/wiselinks
Upcoming SlideShare
Loading in …5
×

Make Rails app’s page loads faster with Wiselinks

1,821 views

Published on

  • Be the first to comment

  • Be the first to like this

Make Rails app’s page loads faster with Wiselinks

  1. 1. Make Rails app’s page loads faster with Wiselinks Vu Ngoc Anh
  2. 2. What’s Wiselinks • Is a gem likes Turbolinks to make page loads faster by using AJAX and history APIs as pushState to replace the content of page instead of re-rendering all of the page • pushState is a method of History API (HTML5) allows Javascript to store data in session history with title & url • Turbolinks is shipped as default in Rails 4
  3. 3. The difference with Turbolinks • Wiselinks work as a whitelist when Turbolinks work as blacklist • Processes 30x http redirects • Works in browers that don’t have History API • Can handle form processing
  4. 4. Installation • Add “ gem ‘wiselinks’ ” to Gemfile then bundle • Add “//= require wiselinks” and create wiselinks object “window.wiselinks = new Wiselinks()” in application.js • Add attribute “ data-push=‘true’ ” to link want to use wiselink
  5. 5. Demo
  6. 6. Notes • Use ‘wiselinks_title’ helper to set title of page • Problem when using ‘document.ready’ • Event: ‘page:loading’, ‘page:redirected’, ‘page:always’, ‘page:done’, ‘page:fail’
  7. 7. Thank you • https://github.com/igor-alexandrov/wiselinks

×