Patrioticcow
Patrioticcow

Reputation: 27038

server requests, how to handle them?

I have this application that has a form with a drop-down list and a button.

After the form is submitted, another form is loaded in the page using ajax. this happens 5 times.

all forms are the same and contain only a drop-down list and a button.

also each form has attached to it a mysql query that determines what each drop-down will contain.

My question deals with the server requests. I believe that in this application i do 5 server requests, one for each form .

Is it better to create a single page that contain all forms vs the app described above?

i am talking at a load on 80.000 people hitting this application

thanks

edit:

the app works like this:

there is a drop down -> user selects a option and submits ---with ajax---> another form is loaded, a query is made based on previous selection -> user selects a option and submits....etc 5 times

Upvotes: 3

Views: 95

Answers (1)

jayunit100
jayunit100

Reputation: 17648

Yes - no need to hit the db every time... unless the forms are data driven and the mysql query uses input from the users. I would build the whole form into the JavaScript beforehand.

Upvotes: 1

Related Questions