Reputation: 4792
I deploy code to my production server using git. This might include changes to JS and CSS files.
Do I have to run rake assets:clean
at all before I run rake assets:precompile
? I'm worried that not cleaning the previous precompiled assets might have side effects.
This is a little silly, but my google-fu didn't find any answers. My AWS instance runs rake assets:clean
pretty slowly and I'm wondering if it's needed at all.
Also, can I replace the clean command with a simple rm -r public/assets
?
Upvotes: 11
Views: 6489
Reputation: 4097
No you do not need to run rake assets:clean before, just running rake assets:precompile will recompile your assets. It will recreate your cache busting digest and manifest.yml (which contains key/value mappings that match each asset name to its MD5 cache-busted name)
and yes you can just run rm -r public/assets
Upvotes: 12