sprockets-rails
sprockets-rails copied to clipboard
Rake task for completely clear assets cache
Clearing tmp/cache/assets is necesasry to regenerate assets correctly, but rails assets:clean or rails assets:clobber does not clear tmp/cache/assets.
I spent hours to solve cache issue after changing config.assets.prefix...
While it can be done with tmp:cache:clear, I think it'd better to have own task to clear that dir to avoid confusion.
Possible solutions:
- Add
assets:clear-cachetask to runrm -rf tmp/cache/assets. - Add
assets:clean-alltask to run clobber andrm -rf tmp/cache/assets. - Add reference to tmp/cache/assets or
tmp:cache:clearto the document.
Related issues
It was previously part of assets:clean:
https://github.com/rails/rails/pull/2448
There are similar reports on other (wrong) repos: https://github.com/twbs/bootstrap-sass/issues/550 https://github.com/rails/sass-rails/issues/118
Document for clearing cache was improved in this PR: https://github.com/rails/sprockets-rails/pull/335
If I understand correctly, this issue might be resolved by rails/sprockets#257, which changes the assets:clobber task to also clear the Sprockets cache store (tmp/cache/assets) in addition to all precompiled assets.
Could you try this task using master version of sprockets (no release has been published yet since this PR has been merged) and see if it fixes your issue?
Clearing tmp/cache/assets is necesasry to regenerate assets correctly, but
rails assets:cleanorrails assets:clobberdoes not clear tmp/cache/assets. I spent hours to solve cache issue after changing config.assets.prefix...While it can be done with
tmp:cache:clear, I think it'd better to have own task to clear that dir to avoid confusion.Possible solutions:
- Add
assets:clear-cachetask to runrm -rf tmp/cache/assets.- Add
assets:clean-alltask to run clobber andrm -rf tmp/cache/assets.- Add reference to tmp/cache/assets or
tmp:cache:clearto the document.Related issues
It was previously part of
assets:clean: rails/rails#2448There are similar reports on other (wrong) repos: twbs/bootstrap-sass#550 rails/sass-rails#118
Document for clearing cache was improved in this PR: #335
@taylorjalpha