# This has been taken wholesale from https://gist.github.com/sj26/4728657

# Stick this in lib/tasks/assets.rake or similar
#
# A bug was introduced in rails in 7f1a666d causing the whole application cache
# to be cleared everytime a precompile is run, but it is not neccesary and just
# slows down precompiling.
#
# Secondary consequences are the clearing of the whole cache, which if using
# the default file cache could cause an application level performance hit.
#
# This is already fixed in sprockets-rails for rails 4, but we patch here for
# interim gains.
#
# If you're using rails pre-3.2 change "primary" to "digest" below.

Rake::Task["assets:precompile:primary"].prerequisites.delete "tmp:cache:clear"
Rake::Task["assets:precompile:nondigest"].prerequisites.delete "tmp:cache:clear"
Remove cache clearing from asset precompilation
Remove cache clearing from asset precompilation

Chatting with Edd in our office, the subject of slow asset
precompilation came up.  As we're now considering using a set of
dedicated stylesheets for right-to-left languages, each of which needs
compilation, the current poor performance will only get worse.

James M mentioned this blog post[1] which seems to have a fix.
Running it locally on my machine reduced the time taken for asset
compilation down from 2:21 to 0:26.

[1] http://sj26.com/2013/02/09/the-asset-pipeline-isnt-actually-slow
