3 ms·
If you want to remove the need to redownload global assets/parse them on every page load, you can use pjax to do so. It'll only reload certain parts of the page
by Jarred 15y ago
If you want to remove the need to redownload global assets/parse them on every page load, you can use pjax to do so. It'll only reload certain parts of the page that you specify, meaning if, for example, you're using Rails 3.X and all the code for the views require jquery and the jquery_ujs adapter, you'd stick that into your application.js manifest.
In your views you'd have a javascript_include_tag (or just the src tag) to that view's JS file. From there, between clicking on links within the same domain, it'll only reload the parts you tell it to.
There's a gem that does this for Rails https://github.com/nz/pjax-rails https://github.com/nz/pjax-rails and if you're not using Rails there's a version dependent on jQuery https://github.com/defunkt/jquery-pjax https://github.com/defunkt/jquery-pjax.