Soichi Ishida wrote in post #1080153: > Rails 3.1.3 > > Not all javascript files are necessary for every page of app. > If I put all JavaScript files in app/assets/javascripts/ , all of them > are compiled and read in every page. I believe this is a waste of > memory space and CPU load. > >
Yeah this is a non-issue. Assets are pre-compiled and cached in production server side as described here: http://guides.rubyonrails.org/asset_pipeline.html#in-production And client browser will also cache them so they won't get loaded on every page. But even worse case scenario and somehow things keep getting reloaded, unless you've got some massive framework with 200+.js files, the processing overhead from serving a few javascript files is really miniscule. I wouldn't bother with including scripts only in the pages that use them. Keep things simple for yourself and include everything in your application layout. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

