Idea #21887 for Tornado server
In our project management app ProjectReator, there's a bunch of web 2.0 (gee I HATE that term!) whizzbangery. Like popup calendars, prototype, scriptaculous, shadowed boxes, flyout menus, ... Each of these typically uses its own .js and .css file(s). It works great, but the rub is performance.
In the land of http, when you request a page, your browser gets the page back, looks in the <head> for css and javascript includes and makes suibsequent requests for them. Wouldn't it be great if the browser pulled down only one .css file and one .js file? Hmm yes but as a developer what a nightmare to update one HUGE file instead of a few small ones.
So here's the idea.
On the Tornado server side, create a new design element which contains a list of all the files to concatenate in its response. For example, the page has 'all.css' listed in the <head> when the browser asks the server for 'all.css' it known to grab all the css files (resources) listed that resource and return them as a single reply.
The best of both worlds, from a programming and maintenance perspective things are easy to manage and from a performance perspective the site appears snappy. Now I just have to build it...
Introducing Sprockets: JavaScript dependency management and concatenation
Comment posted by Ben Poole on 2009-03-19 23:26:16.0 | mail