[html-formfu] Speed of processing

Octavian Râşniţă orasnita at gmail.com
Mon Nov 2 15:01:14 GMT 2009


From: "Kahlil Hodgson" <kahlil.hodgson at dealmax.com.au>
On 10/30/2009 08:37 AM, Octavian Râşniţă wrote:

> You are probably right. I don't think I understand very well why the
> form should be cloned,

Carl is right on the money :-) Cloning is definitely necessary and is
what I use in my single-process cache.  Think of the case where two
different clients try to process the same form at roughly the same time
(and are using the same catalyst process)

   1. A requests a page gets the form first and initialises the cache
   2. B requests the same page gets the same form object from the cache
   3. A submits the form with errors using the same form object as B
(from the cache)
   4. B submits the form without errors but using the same form object
as A (from the cache)

Not too sure, but either A gets no errors or B gets the errors from A.
There are a bunch of other similar cases, but the upshot is that we have
to separate the objects used by different requests.


**
Ok, but if each user should have its own form, then how does the cache help 
the users?
I thought that the forms could be saved without the data they contain... 
only the structure of the form, without any data, which should be the same 
for all users.
In that case the program wouldn't need to parse the config files and 
wouldn't need to re-generate the form object, but only set that object with 
the data supplied by the user. Is it possible something like this?

I just found that I need to put a login form on all the pages, so the speed 
of the entire site would decrease very much because of this...


Octavian




More information about the HTML-FormFu mailing list