I want to display a This page took x seconds
widget at the bottom of every page in my rails application. I would like x
to reflect the approximate amount of time the request spent on my server. What is a good way of doing this?
Edit: My production server is on phusion passenger and development environment on mongerel. Would love to have a solution that works well with both.
Update: I think for the purpose of this question, the railscast solution is a bit overboard. I modified the middleware suggested in there to just set up a constant and used that in my layout. This way I won't have to change any content-length headers. Thanks again neutrino. Rack middleware are very interesting.