Reducing Client/Server traffic
Session Variable Lists can be controlled as a just-in-time requirement, instead of loading them ALL at Login… We first were pulling in all of our required drop-down data as soon as a user logs in, and then would reuse these to repopulate (from session) as needed on all forms and pages.
Well we started this way and then needed a refresh process for when the drop-data gets changed by the current user. Example: A user needs to assign an employee to a new route/task (via drop-down) and also add new devices prior to assigning them as well (via drop-down).
Simple: The form which adds new devices (sets a refresh flag); an include file of all drop-down selections is invoked prior to the usage of all forms and the new session list is built. The user now has the new drop-down data and can continue in finishing the original assignment process.
Update: So now all the selection lists are being made at login and again as needed when the refresh flag is set.
The next step was to use JITS (just-in-time-selection) drop-down builds based on the form requirements as each page is called, instead of building them all at once (during logon). We created an include ASP procedure which we call with the form name prior to using the form each time it is used. This procedure builds all drop-down lists (only if not already built). This helps to eliminate the big wait just after logon, which was getting pretty obvious, and eliminated the extra work being done for forms (drop-down) requirements which were not even being used.
We researched our “logon history” table and found that most of our users were logging in to accomplish the following (as a one user session):
1. Multiple adds, updates, deletes within the same form types, same logon.
2. Most of the previous data changes were followed by queries on same data.
NOTE: Our inserts are data entry type forms, so the user can repeatedly enter new records as quickly as they can type and hit enter. So within the first call to a form, we load the required session drop-downs (this form only), and then reuse them as needed.
Our review also showed that each logon would concentrate on only a small percentage of our total forms at each logon session. Meaning they would logon again and again throughout the day for doing very different and selected processes.
Our savings in session variables and SQL requests has become quite noticeable!