我正在嘗試升級到雪松/資產管道,並且在忙於某些事情。如何獲取資產緩存工作
一切都呈現良好,但我的應用程序似乎明顯慢。展望thorugh我的日誌我看到噸的項目像這樣:
2012-03-15T17:03:02 + 00:00的應用[web.1]:緩存:GET /assets/application.js]小姐2012-03-15T17:03:02 + 00:00 app [web.1]: 緩存:[GET /assets/down_arrow.gif]小姐2012-03-15T17:03:02 + 00:00 app [ web.1]:緩存:[GET /assets/application.css]錯過
我希望這些是命中 - 對吧?
我production.rb
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# For nginx:
config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
# I also tried these
# config.action_dispatch.x_sendfile_header = "X-Sendfile"
# config.action_dispatch.x_sendfile_header = nil
config.cache_store = :dalli_store
我的application.rb中
...
config.assets.enabled = true
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
config.assets.initialize_on_precompile = false
config.active_support.deprecation = :log
注意:assets:precompile
上部署工作正常:
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
-----> Rails plugin injection
Injecting rails_log_stdout
Injecting rails3_serve_static_assets
謝謝!如果您需要更多信息,請告知我
當您部署時,您是否在您的heroku日誌中看到資產編譯? – phoet 2012-03-16 17:00:07
應該有類似'----->爲Rails資產管道準備應用程序 運行:rake資產:預編譯「 – phoet 2012-03-16 17:00:36
yup - 我將用該信息更新該問題 – Jonathan 2012-03-16 17:26:23