0

config/environment/development.rb ファイルで、次の設定を見つけました。

config.assets.debug = false  # Debug mode disables concatenation and preprocessing of assets.

多数の javascript ファイルと css ファイルを使用すると、開発サーバーが大幅に高速化されました。

唯一の問題は、画像をロードするときに、開発サーバーが各画像をロードするのに時間がかかることです。サーバー出力は次のとおりです。

Started GET "/assets/shamcey/logo.png" for 10.0.2.2 at 2013-09-01 12:08:35 -0700


Started GET "/assets/shamcey/photos/thumb10.png" for 10.0.2.2 at 2013-09-01 12:08:36 -0700


Started GET "/assets/shamcey/leftpanelbg.png" for 10.0.2.2 at 2013-09-01 12:08:36 -0700


Started GET "/assets/shamcey/icons/message.png" for 10.0.2.2 at 2013-09-01 12:08:37 -0700


Started GET "/assets/shamcey/icons/users.png" for 10.0.2.2 at 2013-09-01 12:08:37 -0700


Started GET "/assets/shamcey/icons/bar.png" for 10.0.2.2 at 2013-09-01 12:08:38 -0700


Started GET "/assets/shamcey/droparrow.png" for 10.0.2.2 at 2013-09-01 12:08:38 -0700


Started GET "/assets/shamcey/bg1.png" for 10.0.2.2 at 2013-09-01 12:08:38 -0700


Started GET "/assets/shamcey/bcarrow.png" for 10.0.2.2 at 2013-09-01 12:08:39 -0700


Started GET "/assets/shamcey/bcarrow.png" for 10.0.2.2 at 2013-09-01 12:08:39 -0700


Started GET "/assets/shamcey/glyphicons-halflings.png" for 10.0.2.2 at 2013-09-01 12:08:39 -0700


Started GET "/assets/shamcey/icons/search.png" for 10.0.2.2 at 2013-09-01 12:08:40 -0700


Started GET "/assets/shamcey/icons/icon-event.png" for 10.0.2.2 at 2013-09-01 12:08:40 -0700


Started GET "/assets/shamcey/icons/icon-cart.png" for 10.0.2.2 at 2013-09-01 12:08:40 -0700


Started GET "/assets/shamcey/icons/icon-archive.png" for 10.0.2.2 at 2013-09-01 12:08:41 -0700


Started GET "/assets/shamcey/icons/icon-help.png" for 10.0.2.2 at 2013-09-01 12:08:41 -0700


Started GET "/assets/shamcey/icons/icon-images.png" for 10.0.2.2 at 2013-09-01 12:08:42 -0700


Started GET "/assets/shamcey/glyphicons-halflings-white.png" for 10.0.2.2 at 2013-09-01 12:08:42 -0700


Started GET "/assets/shamcey/calarrow.png" for 10.0.2.2 at 2013-09-01 12:08:42 -0700

開発モードで画像の読み込みを高速化する方法はありますか?

4

1 に答える 1

0

これで問題は解決します。

config.cache_classes = true
于 2013-12-17T21:21:06.767 に答える