Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
481 views
in Technique[技术] by (71.8m points)

ruby on rails - 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

To purge Heroku's asset cache, you need the Heroku Repo plugin to the Heroku toolbelt. Install that, then use the command

heroku repo:purge_cache

Deploy after purging the cache.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...