Skip to content

Instantly share code, notes, and snippets.

@nirvdrum
Created February 26, 2010 20:33
Show Gist options
  • Save nirvdrum/316119 to your computer and use it in GitHub Desktop.
Save nirvdrum/316119 to your computer and use it in GitHub Desktop.
stylesheet_link_tag(AssetCache::BASE_CSS, :cache => 'cached/base')
class AssetCache
include ActionView::Helpers::TagHelper
include ActionView::Helpers::AssetTagHelper
BASE_CSS = ['jquery-ui', 'formtastic', 'mogo']
def warm
stylesheet_link_tag(BASE_CSS, :cache => 'cached/base')
end
end
namespace :assets do
desc "Warm the asset caches"
task :warm_caches => :environment do
AssetCache.new.warm
end
end
before 'deploy:restart', 'warm_asset_caches'
task :warm_asset_caches, :roles => :app do
run "cd #{current_path}; RAILS_ENV=#{RUBBER_ENV} rake assets:warm_caches"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment