Permalink
Browse files

Removed the CLEAN_EXPIRED_ASSETS env option - Heroku doesn't support …

…env vars during compile, so it's largely useless
  • Loading branch information...
1 parent 4f8dfda commit 0171cf06bdd5aad1fd72ed6f44ff419bd8b42ce7 @ndbroadbent committed Oct 29, 2012
Showing with 2 additions and 9 deletions.
  1. +2 −4 README.md
  2. +0 −5 lib/turbo-sprockets/tasks/assets.rake
View
@@ -42,10 +42,8 @@ Enjoy your lightning fast deploys!
## Removing Expired Assets
-`turbo-sprockets-rails3` can now remove expired assets after each compile. If the environment variable `CLEAN_EXPIRED_ASSETS` is set to `true`, the `assets:clean_expired` task will be run after `assets:precompile`.
-An asset will be deleted if it is no longer referenced by `manifest.yml`, and hasn't been actively deployed for more than 7 days (default).
-
-To expire old assets after precompile, you should compile assets by running `CLEAN_EXPIRED_ASSETS=true rake assets:precompile`. Alternatively, you can run `rake assets:precompile assets:clean_expired`.
+`turbo-sprockets-rails3` can now remove expired assets after each compile by running the `assets:clean_expired` task after `assets:precompile`.
+An asset will be deleted if it is no longer referenced by `manifest.yml`, and hasn't been actively deployed for more than a day (default).
You can configure the expiry time by setting `config.assets.expire_after` in `config/environments/production.rb`.
An expiry time of 2 weeks could be configured with the following code:
@@ -195,8 +195,3 @@ task_enhancements.each do |task_name, actions|
Rake::Task[task_name].enhance &proc
end
end
-
-# Clean expired assets after asset precompile, if CLEAN_EXPIRED_ASSETS is set
-Rake::Task["assets:precompile:all"].enhance do
- Rake::Task["assets:clean_expired:all"].invoke if ENV['CLEAN_EXPIRED_ASSETS'].in? %w(true yes 1)
-end

2 comments on commit 0171cf0

@jjb
jjb commented on 0171cf0 Nov 8, 2012
@ndbroadbent
Owner

Right, that's true. I just added the clean_expires task to my fork of the heroku build pack. I've also pushed a built-in assets expiry feature for capistrano. Hopefully my heroku build pack PR will be merged soon, but you can use the fork until then. It will automatically cache and clean expired assets when the turbo-sprockets-rails3 gem is detected.

Please sign in to comment.