Rails, what’s wrong with serving static JS and CSS files?

Posted by Michael Hendrickx on October 05, 2011
Javascript, rails

For a new web project, I’ve been looking at Rails 3.1, the latest update of the popular Ruby on Rails web application framework.

Although I just started on it, and haven’t seen all the goodness, one thing that raised my eyebrows is how static content a la CSS and JavaScript is handled, through an asset pipeline.

In a nutshell, since I’m doing the JQuery bit of the site now, wouldn’t it make much more sense to fetch the libraries from CDN’s, cache the remaining recurring libraries in Nginx (or Apache), and leaving the page specific bits in one big <script> tag, instead of pushing all in a bloated application.js page?

Then again, although I think Rails was what the web community needed, I always had my ideas about frameworks.

Thanks,
Michael

1 Comment to Rails, what’s wrong with serving static JS and CSS files?

Michael Hendrickx
October 14, 2011

Oh great – if you disable the pipeline, Rails won’t run at all.

Leave a comment

WP_Big_City