rails/turbolinks — pull request #336 by reed (2014-02-01 05:04:48+00:00)
Title: [Alternative Solution] Always use absolute URLs for cache keys and in state objects - Fixes #333 Closes #334

@k1w1 Your fix (#334) has the right idea, but it won't work when traversing the browser history. When you hit the back button and `cacheCurrentPage` is called, `document.location.href` has already changed to the new URL. So you'll end up with a page cached with the wrong key. Try out my solution and let me know if it works for you.

@dhh I also did a bit of refactoring to clean up and organize the code. Does it look good to you?