1. Express Timeout setting
If the HTTP request does not return a value for a period of time, Express sends the request back to the background. In the case of a long background method execution, repeated requests will be repeated, causing the foreground to receive an empty response, a err_empty_response error, suspected because a long time no response,express automatically return the status code to the foreground.
According to the actual measurement, express default wait time seems to be 4 minutes (in doubt), to change the default wait time needs to be in the project startup script, the following settings
1 varApp = require ('.. /app ');2 varPort = normalizeport (URL | | ' 13000 ');3App.set (' Port ', port);4 5 varServer =Http.createserver (app);6 Server.listen (port);7Server.timeout = 600000;//set the wait time to ask 600 seconds, i.e. 10min8Server.on (' ERROR ', onError);9Server.on (' Listening ', onlistening);
2, DataTables front page and background paging
DataTables Remove "serverside": True, properties, set pagination for the front page, adjust the number of page display bar can be updated immediately display number, do not need to re-read background data.
With less data returned in the background, taking the foreground paging can speed up the page turn and improve the user experience.
Nodejs Study notes (2)