简体   繁体   English

使用项目的Assets文件夹进行缓慢的HTTP加载-Ruby on Rails,Webrick,Localhost,Firefox

[英]Slow HTTP Load with the Assets Folder of the Project - Ruby on Rails, Webrick, Localhost, Firefox

The HTTP Protocol: HTTP协议:

Notice: The cache has been cleared before recording the HTTP protocol. 注意:在记录HTTP协议之前,已清除缓存。

This is a HTTP protocol of the HTTP Watch Addon for Firefox : http://www.mediafire.com/view/?wccimru3qdu19s2# 这是Firefox HTTP Watch Addon的HTTP协议http : //www.mediafire.com/view/? wccimru3qdu19s2#

The HTTP load is around 5 seconds . HTTP负载约为5 seconds

The status code is 200 OK . 状态代码200 OK

The Problem: 问题:

To load the assets folder into the cache Firefox does not do the GET request just on the first time of rendering the web application - it also does it repeatedly on every page load, so that every page rendering becomes too slow. 要将assets文件夹加载到cache Firefox不会仅在第一次呈现Web应用程序执行GET请求-它还会在每次页面加载时重复执行该请求,因此每次页面呈现都变得太慢。

The Questions: 问题:

  1. Is there something specific in Webrick, Ruby, or Rails , which may cause Firefox to do the repeated GET request? Webrick,Ruby或Rails中是否存在某些特定内容,可能会导致Firefox重复执行GET请求?

  2. The HTTP load takes around 5 seconds on the first time rendering of the web application, so the assets folder can be loaded in the cache of Firefox - are there procedures to increase the load speed? 首次呈现Web应用程序时, HTTP加载大约需要5 seconds ,因此assets文件夹可以加载到Firefoxcache中-是否有提高加载速度的过程?

The Addendum: 附录:

Installing the rails-dev-tweaks has increased the speed time from around 5 seconds to around 2.5 seconds . 安装rails-dev-tweaks可以将速度时间从大约5 seconds增加到大约2.5 seconds Where, by now, the repeated GET request is still a persisting problem, which means that around 2.5 seconds for each page load is still too slow. 到目前为止,重复的GET请求仍然是一个持续存在的问题,这意味着每个页面加载大约2.5 seconds仍然太慢。

Add

rails-dev-tweaks

https://github.com/wavii/rails-dev-tweaks https://github.com/wavii/rails-dev-tweaks

to your Gemfile for 'development' environment... 到您的Gemfile中进行“开发”环境...

Currently the issue should only be in dev env., in production it should be working fine already 目前,问题仅在开发环境中,在生产中应该已经可以正常使用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM