Best practices for loading web pages using long server-side scripts
What are the current best practices and methods for loading web pages with server-side scripts of 10 – 15 seconds.
- The user clicks a link > server-side run > returns to the HTML page (blank
Page dwell 10 – 15 seconds).
- The user clicks on the link > and immediately returns to the html page (with progress
bar) > AJAX sends a request to the server > completes the script > returns the results
- Other options (threads?) )
I’m running the Google App Engine (Python) standard environment.
As a best practice, the script does not take 10-15 seconds.
What is your script doing? Does it generate something that you can pre-compute and cache or save in Google Cloud Storage?
If you daisy-chain data store queries together, is there anything you can do to make them happen asynchronously in tandem?
If it really takes 10-15 seconds, then I would say option 2 is a 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