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

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

问题描述

根据 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 consoleRails.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屋!

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