Hi, Lisa et al,

This is commonly considered a best-practice design pattern.  Specifically,

* Any submission causing side effects (non-idempotent) should be done
via POST rather than GET.

* No POST handler should ever return anything but a redirect to the browser.

As you point out, this eliminates the resubmit-on-reload problem.  It
also makes the browser's back button behave properly, interacts better
with cache management, and so forth.

I do not believe there is any particularly high overhead associated
with this pattern.

On 5/27/07, Lisa Klein <[EMAIL PROTECTED]> wrote:
> Hi, running the lastest Mason under Apache and mod_perl.  Just a quick
> performance/efficiency question.
>
> I've started to make very frequent use of the $m->redirect call, in fact
> pretty much every time a client submits a web form:  Pages with forms
> point/submit to themselves, validation is performed in the <%init>, and if
> no errors need to be displayed, a $m->redirect is performed to take the user
> to a "submission successful" page.  Part of the reason I prefer using a full
> redirect (as opposed to just a component call for output) is that a
> subsequent browser refresh won't result in the form being resubmitted.
>
> This is a relatively large website, including over a hundred pages of
> various forms that are being handled like this.  Is there a
> performance-related reason not to handle forms like this?  Is there a large
> amount of overhead associated with $m->redirect, etc?  Any other
> comments/suggestions appreciated.  Thanks!
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Mason-users mailing list
> Mason-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mason-users
>
>


-- 
Craig Berry - http://www.cine.net/~cberry/
"The road of excess leads to the palace of wisdom." - William Blake

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to