Rendering HTML outside of a controller

I would like to pre-render some commonly accessed pages to speed up response.
Is there any way to do this outside of a controller?

TIA,
  Jeffrey

If you are talking about implementing caching, yes, you can: http://guides.rubyonrails.org/caching_with_rails.html

There are also a couple of Railscasts about the different caching techniques.

Best regards

Peter De Berdt

Quoting Peter De Berdt <peter.de.berdt@pandora.be>:

> I would like to pre-render some commonly accessed pages to speed up
> response.
> Is there any way to do this outside of a controller?

If you are talking about implementing caching, yes, you can: http://guides.rubyonrails.org/caching_with_rails.html

Not quite, I am talking about rendering before the first request, so the page
is already in the cache. Pre-emptive caching? Whatever.

Jeffrey

That doesn't make any sense. How is the browser supposed to know what
you are going to do before a request is made?

Caching on the server side, e.g., /index.html. I know it is going to be
requested often, it's the landing/home page.

Quoting pepe <Pepe@BetterRPG.com>:

Oh, and rendering, i.e. generating the HTML, on the server side, not rendering
HTML in the browser.

Jeffrey

Quoting pepe <Pepe@BetterRPG.com>:

If the index page is served from the cache 99% of the time (or more if
it truly is static), why are you so concerned about pre-rendering it?

You should profile your application to determine the other areas where
you should focus your energy on.

Because the cache is invalidated every few minutes, the wait is annoying, and
the CPU is either idle or running 100%. If the load can be spread out more,
responsiveness will improve. I have profiled the requests, cut the response
time in half, and it is still annoying slow, several seconds. I need a 10x
increase and have only found several improvements totaling a 2x increase.
Short of changing the underlying engine from Ruby 1.8 to Ruby 1.9 or jRuby or
going to a template engine written in a compiled language, I don't see any way
to increase the responsiveness short of pre-filling the cache where feasible.

Jeffrey

Quoting E. Litwin <elitwin@rocketmail.com>: