On 03 Aug 2007, at 16:22, Richard Quadling wrote: > Depending upon your server side code, take a look at ... > > http://rakaz.nl/projects/combine/combine.phps > > http://rakaz.nl/item/ > make_your_pages_load_faster_by_combining_and_compressing_javascript_an > d_css_files > > Using caching makes a SIGNIFICANT difference to bandwidth usage. They > load the file once. > > I use a modified version of this and it has cut down the hits > considerably.
I've dealt with this issue myself and I feel I really need to put this claim in context. You get the most speed benefit from compressing the files before sending them to the user (using mod_deflate from Apache, it's so easy) and by letting Apache serve static files (i.e. cache as much of your dynamically generated code as possible). Period. Letting Apache cache the compressed version will only yield a very small gain (but will bring down the load on your server). Combining all the files into one and then compressing it before sending it to the user didn't give me the results I was expecting. It does shave off a few bytes compared to the compressed individual files, but not enough to make it seem like the ultimate solution, as this article claims. Also note that without caching the combined file, using an interpreter (like php or ruby) to generate one big combined file can actually slow down your application and put a bigger load on your server. One must also keep in mind that after the initial download of the files, the user's browser will just use the locally cached version over and over again, your server won't have to serve the files on every request, whether you're serving one file or more. All I'm trying to say is: don't get tempted by so-called solutions to problems that are seriously exagerated and if you do run into server load issues, you need to find out what's causing it and solve that problem (and I'm pretty sure these few javascript files won't be the bottleneck). Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" 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 this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
