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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 25 Nov 2009, at 23:39, Jeffrey L. Taylor wrote:> 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 There are also a couple of Railscasts about the different caching techniques. Best regards Peter De Berdt -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Quoting Peter De Berdt <peter.de.berdt-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org>:> > On 25 Nov 2009, at 23:39, Jeffrey L. Taylor wrote: > > > 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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
That doesn''t make any sense. How is the browser supposed to know what you are going to do before a request is made? On Nov 25, 7:32 pm, "Jeffrey L. Taylor" <r...-f/t7CGFWhwGcvWdFBKKxig@public.gmane.org> wrote:> Quoting Peter De Berdt <peter.de.be...-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org>: > > > > > On 25 Nov 2009, at 23:39, Jeffrey L. Taylor wrote: > > > > 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-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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-1PhG29ZdMB/g+20BJ0uB2w@public.gmane.org>:> That doesn''t make any sense. How is the browser supposed to know what > you are going to do before a request is made? > > On Nov 25, 7:32 pm, "Jeffrey L. Taylor" <r...-f/t7CGFWhwGcvWdFBKKxig@public.gmane.org> wrote: > > Quoting Peter De Berdt <peter.de.be...-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org>: > > > > > > > > > On 25 Nov 2009, at 23:39, Jeffrey L. Taylor wrote: > > > > > > 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.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Oh, and rendering, i.e. generating the HTML, on the server side, not rendering HTML in the browser. Jeffrey Quoting pepe <Pepe-1PhG29ZdMB/g+20BJ0uB2w@public.gmane.org>:> That doesn''t make any sense. How is the browser supposed to know what > you are going to do before a request is made? > > On Nov 25, 7:32 pm, "Jeffrey L. Taylor" <r...-f/t7CGFWhwGcvWdFBKKxig@public.gmane.org> wrote: > > Quoting Peter De Berdt <peter.de.be...-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org>: > > > > > > > > > On 25 Nov 2009, at 23:39, Jeffrey L. Taylor wrote: > > > > > > 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.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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. On Nov 27, 5:36 pm, "Jeffrey L. Taylor" <r...-f/t7CGFWhwGcvWdFBKKxig@public.gmane.org> wrote:> Oh, and rendering, i.e. generating the HTML, on the server side, not rendering > HTML in the browser. > > Jeffrey > > Quoting pepe <P...-1PhG29ZdMB/g+20BJ0uB2w@public.gmane.org>: > > > That doesn''t make any sense. How is the browser supposed to know what > > you are going to do before a request is made? > > > On Nov 25, 7:32 pm, "Jeffrey L. Taylor" <r...-f/t7CGFWhwGcvWdFBKKxig@public.gmane.org> wrote: > > > Quoting Peter De Berdt <peter.de.be...-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org>: > > > > > On 25 Nov 2009, at 23:39, Jeffrey L. Taylor wrote: > > > > > > 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.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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-ur4TIblo6goN+BqQ9rBEUg@public.gmane.org>:> 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. > > On Nov 27, 5:36 pm, "Jeffrey L. Taylor" <r...-f/t7CGFWhwGcvWdFBKKxig@public.gmane.org> wrote: > > Oh, and rendering, i.e. generating the HTML, on the server side, not rendering > > HTML in the browser. > > > > Jeffrey > > > > Quoting pepe <P...-1PhG29ZdMB/g+20BJ0uB2w@public.gmane.org>: > > > > > That doesn''t make any sense. How is the browser supposed to know what > > > you are going to do before a request is made? > > > > > On Nov 25, 7:32 pm, "Jeffrey L. Taylor" <r...-f/t7CGFWhwGcvWdFBKKxig@public.gmane.org> wrote: > > > > Quoting Peter De Berdt <peter.de.be...-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org>: > > > > > > > On 25 Nov 2009, at 23:39, Jeffrey L. Taylor wrote: > > > > > > > > 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. > > -- > > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.