The first request to my rails app is extremely slow in all environments.
This should not be due different way of caching/loading gems. It was fine two hours ago and no major changes are made.
What I did the hours before I noticed my app turned slow:
I messed around in production.rb (NOT in development.rb): I was playing around with config.serve_static_assets = true
I did a bunch of tasks to diagnose why asset pipeline did not load my stylesheets and images in production (like rake assets:precompile RAILS_ENV=production and rake:clean assets:precompile).
Afterwards I obviously tried to undo all the changes I made, but for some reason my app is now slow in development, while it was perfectly fine before.
How can I fix this?
Thanks in advance :-)
UPDATE 1
When I send a request for localhost:3000, only after 12-13 seconds I receive: Started GET "/" for ::1 at random time
Rendering behaving is normal. All requests after the first one are fine.
UPDATE 2
In an older version of my application I did the following:
- Replace the old 'app'-folder with the newer one
- Replace the old 'db'-files with the newer one
- Replace the old 'config'-files with the newer one
Everything is running smoothly and still have no clue as to what was wrong in the first place. Please note that the version of the app from yesterday still runs slow, so this is not a non-rails related issue.