Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reset Heroku Rails4 asset pipeline cache

According to Heroku documentation:

Heroku now caches 50mb worth of tmp/cache/assets which is a cache directory for the asset pipeline to store intermediate files. This means that future asset compilations will be faster due to not having to recalculate these files.

My question is how do I manually reset or delete this cache so that all of my assets have to be precompiled again? I tried heroku run console and Rails.cache.clear but it did not work. The reason I want to reset the cache is I have changed the config.action_controller.asset_host in my production.rb file but Heroku is not picking up on the change because of the cache.

like image 216
diasks2 Avatar asked Apr 09 '14 22:04

diasks2


1 Answers

As this Stack Overflow answer explains, config.assets.version exists for this purpose.

Most likely, you'll find it in config/application.rb or config/initializers/assets.rb. Change it to any value you want to break the cache next time you deploy to any environment.

like image 55
Isaac Betesh Avatar answered Sep 23 '22 10:09

Isaac Betesh