Thursday, 1 March 2012

Spree performance in development mode - precompiling assets

Important note, borrowed directly form the Spree help docs. Rails 3.1 introduced the concept of the asset pipeline. Unfortunately this causes some significant performance issues when running Spree in development mode. The good news is you can improve performance significantly by using a special precompile task.

$ bundle exec rake assets:precompile:nondigest

Using the precompile rake task in development will prevent any changes to asset files from being automatically included in when you reload the page. You must re-run the precompile task for changes to become available.

Rails also provides the following rake task that will delete the entire public/assets directory, this can be helpful to clear out development assets before committing.
$ rake assets

No comments:

Post a Comment

Comments are moderated, so you'll have to wait a little bit before they appear!