Saiho Yuen
2005-Dec-09 14:44 UTC
if controller is rebuilt each time when we uses redirect_to?
Hi, Does anyone know, if a controller is built each time, when we use "redirect_to" ???? Thanks you very much. Saiho __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Francois Beausoleil
2005-Dec-09 15:35 UTC
Re: if controller is rebuilt each time when we uses redirect_to?
Hi ! 2005/12/9, Saiho Yuen <sayoyo@yahoo.com>:> Does anyone know, if a controller is built each time, > when we use "redirect_to" ????What do you mean by 'rebuilt' ? -- François Beausoleil http://blog.teksol.info/ _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Saiho Yuen
2005-Dec-09 16:10 UTC
Re: if controller is rebuilt each time when we uses redirect_to?
Hi, As I understanded (I could be worng), when a request is sent to Rails, Rails will create a controller object to answer that request, after that the controller object will be destroyed by Rails. There is no object pool inside of Rails. if we use "redirect_to" from page A(controller A) to page B (controller B), I think the controller A is destroyed, then Rails creates controller B. (Am I correct?) I wonder if we redirect page A/f1 to A/f2 (same controller), is the controller is destroyed and then recreate????? Thanks you very much!!! Saiho --- Francois Beausoleil <francois.beausoleil-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi ! > > 2005/12/9, Saiho Yuen <sayoyo-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>: > > Does anyone know, if a controller is built each > time, > > when we use "redirect_to" ???? > > What do you mean by ''rebuilt'' ? > > -- > François Beausoleil > http://blog.teksol.info/ > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Kent Sibilev
2005-Dec-09 16:51 UTC
Re: if controller is rebuilt each time when we uses redirect_to?
redirect_to from action A to B is no different from if you type in the URL for action B in your browser and submit it. A new controller instance is created for every request. Kent. On Friday 09 December 2005 11:10, Saiho Yuen wrote:> Hi, > > As I understanded (I could be worng), when a request > is sent to Rails, Rails will create a controller > object to answer that request, after that the > controller object will be destroyed by Rails. There is > no object pool inside of Rails. > > if we use "redirect_to" from page A(controller A) to > page B (controller B), I think the controller A is > destroyed, then Rails creates controller B. (Am I > correct?) I wonder if we redirect page A/f1 to A/f2 > (same controller), is the controller is destroyed and > then recreate????? > > Thanks you very much!!! > > Saiho > > > > --- Francois Beausoleil > > <francois.beausoleil-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hi ! > > > > 2005/12/9, Saiho Yuen <sayoyo-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>: > > > Does anyone know, if a controller is built each > > > > time, > > > > > when we use "redirect_to" ???? > > > > What do you mean by ''rebuilt'' ? > > > > -- > > François Beausoleil > > http://blog.teksol.info/ > > > > > _______________________________________________ > > > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Saiho Yuen
2005-Dec-09 18:43 UTC
Re: if controller is rebuilt each time when we uses redirect_to?
Hi, Thanks you very much for the information, but I wonder if each time rails receives a request and recreate an instance of controller, is it too heavy? for a simple controller, it is quit correct, but if we a "huge" one, it may not be the best solution... is there someway, we can optimize this...? thanks you very much Saiho --- Kent Sibilev <ksruby-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> redirect_to from action A to B is no different from > if you type in the URL for > action B in your browser and submit it. A new > controller instance is created > for every request. > > Kent. > > On Friday 09 December 2005 11:10, Saiho Yuen wrote: > > Hi, > > > > As I understanded (I could be worng), when a > request > > is sent to Rails, Rails will create a controller > > object to answer that request, after that the > > controller object will be destroyed by Rails. > There is > > no object pool inside of Rails. > > > > if we use "redirect_to" from page A(controller A) > to > > page B (controller B), I think the controller A is > > destroyed, then Rails creates controller B. (Am I > > correct?) I wonder if we redirect page A/f1 to > A/f2 > > (same controller), is the controller is destroyed > and > > then recreate????? > > > > Thanks you very much!!! > > > > Saiho > > > > > > > > --- Francois Beausoleil > > > > <francois.beausoleil-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi ! > > > > > > 2005/12/9, Saiho Yuen <sayoyo-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>: > > > > Does anyone know, if a controller is built > each > > > > > > time, > > > > > > > when we use "redirect_to" ???? > > > > > > What do you mean by ''rebuilt'' ? > > > > > > -- > > > François Beausoleil > > > http://blog.teksol.info/ > > > > > > > > _______________________________________________ > > > > > > Rails mailing list > > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > protection around > > http://mail.yahoo.com > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >If God really exists, I would like to know what the dinosaurs have done to deserve their extinction. Water is unknown to fishes, until they discover air. http://www.geocities.com/sayoyo/ __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Rick Olson
2005-Dec-09 18:47 UTC
Re: if controller is rebuilt each time when we uses redirect_to?
On 12/9/05, Saiho Yuen <sayoyo-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > Thanks you very much for the information, but I wonder > if each time rails receives a request and recreate an > instance of controller, is it too heavy? for a simple > controller, it is quit correct, but if we a "huge" > one, it may not be the best solution... is there > someway, we can optimize this...? > > thanks you very much > > SaihoI wouldn''t worry about it. Chances are if your page is slow, you''re pulling too much data from the database or something. If your controller is really that big, I''d also consider splitting it up into multiple controllers. -- rick http://techno-weenie.net
Scott Barron
2005-Dec-09 21:04 UTC
Re: if controller is rebuilt each time when we uses redirect_to?
On Dec 9, 2005, at 1:43 PM, Saiho Yuen wrote:> Hi, > > Thanks you very much for the information, but I wonder > if each time rails receives a request and recreate an > instance of controller, is it too heavy? for a simple > controller, it is quit correct, but if we a "huge" > one, it may not be the best solution... is there > someway, we can optimize this...? > > thanks you very much > > SaihoRelative to the rest of the processing happening on each request, the time it takes to instantiate your controller object would be the least of your worries. It''s negligible in the grand scheme of things. Your controllers should not be "huge" anyway. Are you having some specific performance problems? -- Scott Barron Lunchbox Software http://lunchboxsoftware.com http://lunchroom.lunchboxsoftware.com http://rubyi.st
Joe Van Dyk
2005-Dec-09 21:08 UTC
Re: if controller is rebuilt each time when we uses redirect_to?
On 12/9/05, Saiho Yuen <sayoyo-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > Thanks you very much for the information, but I wonder > if each time rails receives a request and recreate an > instance of controller, is it too heavy? for a simple > controller, it is quit correct, but if we a "huge" > one, it may not be the best solution... is there > someway, we can optimize this...?Hint: Don''t try to optimize anything until you can prove that it''s your application''s bottleneck.