Hello everybody. I'm writing a Perl script managing forms submissions
but encounter some difficulty on a step.
1) User submits a form (using POST method). The page being declared as
cacheable with "Cache-Control: max-age=10000".
2) The server-script receives the data, parse and validate them.
2b) If something sounds wrong, it returns a page containg an explicit
error message and a link going to previous cached form (using javascript
history.back).
2c) If all sounds right, it returns a modifiable preview (a web page
containing a formatted output and a pre-filled form in case he wants to
change something). This page is also declared cacheable as the first
one. Here, user can submit the preview as is, or generate a new
modifiable preview.
3) We renew the serial of steps #2. The problem is that, here (after
step #3), if we fall in case #2b, the link doing history.back return to
a non cached page (in spite of "Cache-Control: max-age=10000" in that
page) !
From this constat, I have two questions to ask you :
- Why my first form is well cached (1 -2 -2b -1 works) while next
ones are not (2c -2 -2b -2c doesnt' work : form is not in cache)
- Does my strategy about "what to do when server-side validation find
something wrong ?" is a good one (i.e. provide an history.back(-1)) or
should I go to another direction ?