有没有办法在Heroku上为Rails 4应用程序缓存预编译资产?
我按照this blog post和一些heroku文档中的说明进行操作,这些文档可以考虑加速,但仍需要预编译资产。
这是我的gemfile中的相关部分(也发现它需要enable the 'user-env-compile' lab):
group :production, :staging do
# for heroku, see https://devcenter.heroku.com/articles/rails-integration-gems
gem 'rails_12factor'
# https://devcenter.heroku.com/articles/rack-cache-memcached-rails31
gem 'rack-cache'
gem 'kgio'
# faster heroku deploys (http://blog.alexmaccaw.com/faster-deploys)
gem 'memcachier'
gem 'dalli'
end
从我的config / production.rb和config / staging.rb:
# Neither of the below worked (tried separately)
# config.assets.cache_store = :dalli_store
config.assets.configure {|env| env.cache = ActiveSupport::Cache.lookup_store(:dalli_store) }
谢谢!
答案 0 :(得分:1)
看一下assets_sync gem。