如何重置Heroku Rails4资产管道缓存 [英] How to reset Heroku Rails4 asset pipeline cache

查看:139
本文介绍了如何重置Heroku Rails4资产管道缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据Heroku的文件


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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆