0

The HTTP Protocol:

Notice: The cache has been cleared before recording the HTTP protocol.

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

The HTTP load is around 5 seconds.

The status code is 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.

The Questions:

  1. Is there something specific in Webrick, Ruby, or Rails, which may cause Firefox to do the repeated GET request?

  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?

The Addendum:

Installing the rails-dev-tweaks has increased the speed time from around 5 seconds to around 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.

Community
  • 1
  • 1

1 Answers1

1

Add

rails-dev-tweaks

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

to your Gemfile for 'development' environment...

Currently the issue should only be in dev env., in production it should be working fine already

Rahul garg
  • 9,202
  • 5
  • 34
  • 67
  • Thanks for the suggestion - yet I am getting an error, when trying to install the package: `ERROR: While executing gem ... (RuntimeError) Unknown command rails-dev-tweaks` – user1860822 Dec 14 '12 at 19:24
  • have you added it to your gemfile ? – Rahul garg Dec 14 '12 at 19:25
  • Thanks for the response, it has worked out. Nevertheless, installing it has increased the speed time from around `5 seconds` to around `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. – user1860822 Dec 14 '12 at 19:57
  • by looking to webrick logs on your console..can you identify which part is actually taking time. Is it actually the GET rquest to your action, or the later ones i.e. loading of js/assets.. – Rahul garg Dec 14 '12 at 20:04
  • Also can you run your app once with `-e production` and notice if any considerable issue in that environment..? – Rahul garg Dec 14 '12 at 20:04
  • To answer your second comment, when starting it with `-e production` I am getting the error message `ActionView::Template::Error (application.css isn't precompiled):`. I can also provide the processing protocol, if there is interest for that. – user1860822 Dec 14 '12 at 20:14
  • You would have to do `config.assets.compile = true` in your production.rb environment file OR you can keep it false and run `bundle exec rake assets:precompile` once before rails s in prodution mode – Rahul garg Dec 14 '12 at 20:18
  • To answer your other question. It are specific `JavaScript (.js)` `file types` at `15 ms`, and at the end it is the `application.js` at `218 ms`. – user1860822 Dec 14 '12 at 20:21