【发布时间】:2015-12-24 06:05:23
【问题描述】:
每当我运行 rails server 时,它都会开始记录大量 GET 请求,特别是对已编译的样式表文件(每半秒左右)。 它们看起来像这样:
Started GET "/assets/application.self-0c7a55ee32b2e31e48453f9129ff2cd12bc8eb34c8a0e51e59e9f4a6adda82cd.css?body=1&_=1450936645614"
我不介意它们,但是我的笔记本电脑在运行 rails server 时会很快耗尽电量,我不知道这是否是原因。
我真的很想知道这是否是正常行为。而且,如果不是,那么每秒有多少请求可能是什么原因。
非常感谢!
编辑:
这是我展示你的 config/enviroments/development.rb 文件,@uDaY
Rails.application.configure do
config.cache_classes = false
config.eager_load = false
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
config.action_mailer.raise_delivery_errors = false
config.active_support.deprecation = :log
config.active_record.migration_error = :page_load
config.assets.debug = true
config.assets.digest = true
config.assets.raise_runtime_errors = true
end
【问题讨论】:
-
显示你的 config/enviroments/development.rb 文件
-
这绝对不正常。您是否使用某种 Javascript 轮询结合 HTTP 标头来抑制资产缓存?
标签: ruby-on-rails server