如何重置Heroku Rails4资产管道缓存 [英] How to reset Heroku Rails4 asset pipeline cache
问题描述
Heroku现在缓存了50MB的tmp / cache / assets,这是缓存
目录,用于资产管道存储中间文件。这
表示由于没有
来重新计算这些文件,未来的资产编译将会更快。
我的问题是如何手动重置或删除此缓存,以便我的所有资产都必须再次预编译?我尝试了 heroku run console
和 Rails.cache.clear
,但它不起作用。我想重置缓存的原因是我更改了 production.rb
文件中的 config.action_controller.asset_host
但Heroku并没有因为缓存而接受更改。
希望这会有所帮助。要在开发中更改 Heroku ,我运行 rake assets:clean
,然后执行 rake assets:precompile RAILS_ENV = production - 在提交之前追踪
并推送至 Heroku
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.
Hopefully this helps. To get changes to Heroku in development I run rake assets:clean
and then rake assets:precompile RAILS_ENV=production --trace
before committing and pushing to Heroku
这篇关于如何重置Heroku Rails4资产管道缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!