开发者

server requests, how to handle them?

开发者 https://www.devze.com 2023-04-11 14:25 出处:网络
I have this application that has a form with a drop-down list and a button. After the form is submitted, 开发者_如何学Goanother form is loaded in the page using ajax. this happens 5 times.

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

After the form is submitted, 开发者_如何学Goanother 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号