[Seaside] REST and Seaside

Avi Bryant avi.bryant at gmail.com
Tue Apr 12 12:04:31 CEST 2005


On Apr 12, 2005 9:47 AM, Dmitry Dorofeev <dima-sender-3c337a at yasp.com> wrote:

> I run some tests about 6 months ago with Seaside Sushi Shop.
> Seems like it is 1 or 2 page per second rate on a 1Ghz FreeBSD box.

Hm, that's a lot slower than the benchmarks I've done.  Maybe I need
to do some more.

> Plus i still can not understand
> why Seaside keep redirecting to itself all the time ?

There are two reasons it does this.  One is to avoid double-submit
problems on page reload: it process the request, which may have side
effects, and then it redirects to a new URL before displaying the next
page.  Reloading will only redo the display, without redoing any side
effects.  The other is to allow the URL to be set by the current state
of the page (that is, any extra bookmarking parameters to be added),
rather than encoded into the link (which would couple the linking page
too tightly to the linked page).  Again, the only way to do this is to
change the state first, and then redirect to a new page.

It's pretty easy to turn this off globally if you don't like it - just
change the "Always Redirect" preference on the configuration page. 
You can also turn this off for individual links, if you know their
side-effects are repeatable, by using #anchorWithCallback:do: instead
of #anchorWithAction:text: (I know, documentation would be nice - I
had literally forgotten this feature myself until I just looked it
up).  This marks the callback as idempotent and thus not needing the
redirect for safety.

> Plus Seaside generates CSS file for each
> page dynamically (I know it is possible to assign static CSS page).

No, it doesn't.  If your #style methods are simply returning static
string literals, the generated CSS URL should stay the same every
time, and your web browser should cache the CSS.

Avi


More information about the Seaside mailing list