2009/11/2 Octavian Râşniţă <orasn...@gmail.com>: > From: "Kahlil Hodgson" <kahlil.hodg...@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?
Kahlil didn't say each user needed their own cache, he was describing a reason why a cache that doesn't clone the form object would fail. As long as the cache gives a clone of the original form each time it's requested, there should be no problem. > 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... A form framework has benefits, but it doesn't have to be used 100% of the time. If the login form on all pages is static (just username / password fields), you could probably hardcode the form html in your template file. Cheers, Carl _______________________________________________ HTML-FormFu mailing list HTML-FormFu@lists.scsys.co.uk http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu