Optimizing Server-Side Actions

You can achieve optimal product performance by consolidating server-side actions. If you combine multiple tasks into a single, larger server-side action, server requests are reduced and performance improved. An optimized product typically launches a minimum number of server-side action requests— ideally one—for each user action, such as a click or selection.

This approach prevents server response delays caused by multiple requests for a single action. To view examples of optimized server-side actions, see Code Examples. For more information about verifying server-side actions performance, see Verifying Server-Side Actions Performance.

As an alternate optimization method for server-side actions, you can apply the lightweight mode, which loads product data only when required. This mode enhances performance for non-optimized server-side actions that do not interact with product data. Functions that require product data are setAnswer(), getTable(), and getQTable().

When applying the lightweight mode, use the scratchpad variable to transfer data from the server to the client. Avoid using questions and answers, QTables, and tables for this purpose. Additionally, excluding functions that load product data can further improve server-side action performance. It is best to use these functions in client-side actions whenever possible to optimize performance.

The list of functions that load product data—even in lightweight mode—includes:

To enable the lightweight mode:

  1. Go to CPQ > Configurator > Settings.

  2. Check the Enable lightweight mode box.

  3. Click Save.

Verifying Server-Side Actions Performance

You can verify the performance of server-side actions by launching a product and appending the "&debug=T" string to the product URL. Then, open the console and analyze the detailed logs for each server-side action. The following image shows example logs that help identify potential performance issues.

An example of server-side action logs in the console.

In the tasks section of the logs, you can view performance metrics in seconds for each server-side action:

  • auth – Represents the time spent on authentication when a server-side action is initiated. The server must verify a user's authorization before they can access server-side functions. A high value may indicate that a large amount of data (megabytes) is being sent. Minimize server-side actions for large data transfers by consolidating them into a single action. Consolidating actions ensures a faster authentication and improves performance.

  • http-data-send and http-data-receive – Show the time required to send data to and from the server. High values usually indicate that temporary data is not being cleared when you send requests to the server. To optimize performance, remove large amounts of data from the scratchpad variable and answers after use.

  • ssa-load-product – Indicates the time required for loading a product. If this key is present, the product has been loaded. If the product should not be loaded,remove functions that load it from the server-side action.

  • other – Corresponds to the time required to perform internal tasks related to the request and prepare the response for the client. A high value may indicate performance issues.

Alternatively, you can view the same metrics presented as percentages in the stats section. The http-data-send and http-data-receive keys are combined under the http_request key.

General Notices