如何重置 Heroku Rails4 资产管道缓存 [英] How to reset Heroku Rails4 asset pipeline cache
问题描述
根据 Heroku 文档:
According to Heroku documentation:
Heroku 现在缓存 50MB 的 tmp/cache/assets,这是一个缓存资产管道用于存储中间文件的目录.这意味着未来的资产编译将更快,因为没有重新计算这些文件.
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.
我的问题是如何手动重置或删除此缓存,以便必须再次预编译我的所有资产?我尝试了 heroku run console
和 Rails.cache.clear
但它没有用.我想重置缓存的原因是我已经更改了 production.rb
文件中的 config.action_controller.asset_host
但 Heroku 由于缓存.
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.
推荐答案
希望这会有所帮助.为了在开发中对 Heroku 进行更改,我运行 rake assets:clean
然后在 之前运行 rake assets:precompile RAILS_ENV=production --trace
承诺并推动Heroku
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屋!