3.1 development and the asset pipeline

With the release of 3.1, it seems that things have drastically changed in the development workflow.

With the asset pipeline enabled, and the likes of this in my layouts:

= stylesheet_link_tag 'application', :debug => Rails.env.development? = javascript_include_tag 'application', :debug => Rails.env.development?

...every single css, js and image gets re-compiled on every single request. This takes forever.

My dev log is mostly comprised of this:

Started GET "/assets/jquery-ui-1.8.16.custom.css?body=1" for at 2011-08-31 14:04:04 -0400 Served asset /jquery-ui-1.8.16.custom.css - 304 Not Modified (0ms)

It seems to me that the dev rails server (both webrick, and passenger), is handling the request of every asset. It didn't work this way in 3.0.x. While it clearly says 304 (0ms) I can attest that the overall time to process a page (and all its assets) is *significantly* longer.

Here's my application.rb and development.rb - they're basically the 3.1 defaults.


So is there a solution here? Even if I didn't have :debug => true in my javascript/stylesheet tag, the JS and CSS files would still have to be complied/generated as well as every image - which is still a significant regression.

In development it recompiles with every reload. In production it only compiles when the files change and serves up the cached version otherwise.

Dieter Lunn http://ubiety.ca

I understand the difference between dev and prod.

The issue here is that in 3.0, a dev page load took half a second or less. It now takes upwards of 5 seconds.

Consider yourself lucky, I had to deal with 5 mins on first load recently. Take a look at the rails-dev-tweaks gem, it helps a lot. In addition to that make sure that you don’t autoload all the models if you use mongoid.

That sounds horrible. I'm seeing this occur on every page load, not just the first one.

You may just move all static assets to public folder. That would get them loaded without involving asset pipeline.

Correct me, if I'm wrong.

I found the speed of delivering the page on the production server improved over a week, but a few images still do not server without bringing the building down. Strangely, favicon - yes that piece of sh1t - in the public folder does not get served at all. This file has nothing to do with assets pipeline man. It's just one of those days....

I am sure there is something missing to it.