Im have a really weird issue, my assets served really slow in development(10 sec per file), thia happens only in Chrome(17.0.963.79). In Firefox all works just fine. My setup:
我有一个非常奇怪的问题,我的资产在开发过程中非常缓慢(每个文件10秒),而这只发生在Chrome(17.0.963.79)中。在Firefox中一切正常。我的设置:
- RVM
- Ruby-1.9.3@p125
- Rails 3.2.0
- Mac OS 10.7.3 I have tried switch from
webrick
tomongrel
andthin
, usingrails-dev-tweaks gem
, set cache classes to true and false. All this didnt help, im stuck why it's work slow only in chrome and not in firefox? Also this is fresh setup of OS, maybe im missing something, thanks!
Mac OS 10.7.3我尝试使用rails-dev-tweaks gem从webrick切换到mongrel和thin,将缓存类设置为true和false。所有这些都没有帮助,我坚持为什么它的工作只在chrome而不是在Firefox中工作缓慢?这也是操作系统的新设置,也许我错过了什么,谢谢!
UPD. If this initial request(e.g. from new tab) all goes smooth. Request take near 2 minute only if im refreshing page. I just can't wrap my head around this issue :(
UPD。如果这个初始请求(例如来自新标签)都顺利进行。如果我正在刷新页面请求接近2分钟。我只是无法绕过这个问题:(
3 个解决方案
#1
8
This seems to have something to do with name resolution.
这似乎与名称解析有关。
Using (chrome) and
使用(铬)和
- localhost:3000/ -- great performance
- 127.0.0.1:3000/ -- great performance
- hostname.local:3000/ - Terrible performance as you describe
localhost:3000 / - 性能很好
127.0.0.1:3000/ - 出色的表现
hostname.local:3000 / - 你描述的糟糕表现
This is unfortunate for me, as I have an alias set up in /etc/hosts to point to 127.0.0.1 that affects how the page gets displayed. So no testing of that in chrome.
这对我来说很不幸,因为我在/ etc / hosts中设置了一个别名,指向127.0.0.1,它会影响页面的显示方式。所以没有测试铬。
#2
2
I had the same problem. Try setting config.assets.debug = false
in development.rb
. It helped in my case.
我有同样的问题。尝试在development.rb中设置config.assets.debug = false。它对我的情况有帮助。
#3
0
We ran into this issue and solved it through using a pow server since it resolves to port 80.
我们遇到了这个问题并通过使用pow服务器解决了它,因为它解析为端口80。
To install pow
安装pow
curl get.pow.cx | sh
Here is a link to the source for the paranoid.
这是偏执狂来源的链接。
Hope that helps.
希望有所帮助。
#1
8
This seems to have something to do with name resolution.
这似乎与名称解析有关。
Using (chrome) and
使用(铬)和
- localhost:3000/ -- great performance
- 127.0.0.1:3000/ -- great performance
- hostname.local:3000/ - Terrible performance as you describe
localhost:3000 / - 性能很好
127.0.0.1:3000/ - 出色的表现
hostname.local:3000 / - 你描述的糟糕表现
This is unfortunate for me, as I have an alias set up in /etc/hosts to point to 127.0.0.1 that affects how the page gets displayed. So no testing of that in chrome.
这对我来说很不幸,因为我在/ etc / hosts中设置了一个别名,指向127.0.0.1,它会影响页面的显示方式。所以没有测试铬。
#2
2
I had the same problem. Try setting config.assets.debug = false
in development.rb
. It helped in my case.
我有同样的问题。尝试在development.rb中设置config.assets.debug = false。它对我的情况有帮助。
#3
0
We ran into this issue and solved it through using a pow server since it resolves to port 80.
我们遇到了这个问题并通过使用pow服务器解决了它,因为它解析为端口80。
To install pow
安装pow
curl get.pow.cx | sh
Here is a link to the source for the paranoid.
这是偏执狂来源的链接。
Hope that helps.
希望有所帮助。