jonhtdk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2009-Jan-27 22:19 UTC
javascript and caching
Hi guys, I''ll start to develop a new app that uses some heavy js librarys (prototype, scriptaculous, tinymce and so on). Someone told me to make all the app using ajax, so all the js files will be loaded only once. My question is, I really must do everything on ajax? Lets say if I call myapp.com/projects and projects use all those js files, then I click on a "show" link and I''m redirected to myapp.com/ projects/1 on this redirect, all js will be reloaded again? Whats the best way to handle with javascript and caching? --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 27 Jan 2009, at 22:19, jonhtdk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> > My question is, I really must do everything on ajax? > > Lets say if I call myapp.com/projects and projects use all those js > files, then I click on a "show" link and I''m redirected to myapp.com/ > projects/1 on this redirect, all js will be reloaded again? >Not necessarily - if your web server is serving the JS files with the correct caching headers then the browser shouldn''t reload them (and using gzip encoding will make a big difference too). Fred> Whats the best way to handle with javascript and caching? > > >--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---