Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best practice for loading webpage with long server side script

What is the current best practice and method of loading a webpage (that has 10 - 15 seconds worth of server side script).

  • User clicks a link > server side runs > html page is returned (blank page for 10 - 15 seconds).
  • User clicks a link > html page is immediately returned (with progress bar) > AJAX post request to the server side > complete script > return result to html.
  • Other options (threading?)

I am running Google App Engine (Python) Standard Environment.

like image 214
beano Avatar asked Aug 13 '26 11:08

beano


1 Answers

Best Practice would be for the the script to not take 10-15 seconds.

What is your script doing? Is it generating something that you can pre-compute and cache or save in Google Cloud Storage?

If you're daisy-chaining datastore queries together, is there something you can do to make them happen async in tandem?

If it really has to take 10-15 seconds, then I'd say option 2 is must:

User clicks a link > html page is immediately returned (with progress bar) > AJAX post request to the server side > complete script > return result to html.

like image 198
Alex Avatar answered Aug 16 '26 02:08

Alex



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!