Network traffic thin Body suggestion
The response time of the browser-side users is affected by many factors, the main three aspects:
Server-side content generation time, impacted by server-side hardware computing power and server application performance
The time that data is transmitted over the network, affected by the network bandwidth and the size of the data transferred
Client-side rendering time, affected by client browser performance and client program performance
Server-side and client performance we have a discussion in other parts of this article series. This section focuses on how to reduce network transmission time. The user's interaction with the server inevitably transmits data over the network. Especially in recent years, WEB2.0 and other technologies, more and more interaction and rendering work transferred to the browser side, showing a page need to transfer more and more data. And the speed of these data transmission, the size of the transmission will affect to a large extent the user to see the page display rate, that is, we are concerned about the response time of the client. As mentioned earlier, this time is affected by network bandwidth and the size of the data being transmitted. Under the condition of network bandwidth, the response speed can be improved effectively by "slimming" the data to be transmitted on the network.
Network traffic not only contains server-side and client-browser network data transmission, if the server side is a network-based multi-node environment, the data between the nodes need to be transmitted over the network, it also takes time. As shown in Figure 1 (This simplified diagram ignores firewalls, proxy server, caching server and other factors), in this simplified application service model, network transport exists between the client browser and the Web server, as well as between the Web server and the application server, and between the application server and the database server. If the model is more complex, there is also network traffic between the proxy server, the caching server, and the client and the primary server. Therefore, reducing the number of data transmission between the nodes and data transmission can improve the response time and throughput of the system to a great extent, and reduce the probability of the performance bottleneck appearing.
To reduce network traffic, it is generally handled in several ways:
Only the necessary data is transmitted.
If you want to display a page on the client side, it is sufficient to transmit only the data needed to display the current page. Some of the data needed to meet the possible future operations can be transferred after the page is displayed, or when the future operation actually occurs.
Compresses the data to be transferred.
For the content that has to be transferred, you can compress and then do the transfer. For browsers-side customers, well-formed, readable code has no meaning for them. But without affecting the page effect, removing these HTML, JSP, JavaScript, CSS, and other file formats and annotation information is very effective in reducing the size of the file. Compression can be deployed directly to the server to place compressed files, or in the compilation or transmission of the relevant settings to do compression.
When possible, cache data as close to the customer's node as you can.
We learned earlier that the network transport exists between the nodes of each layer. Each layer of transmission takes time. Therefore, if the browser-side request directly from the nearest node to fetch data, not only can save network transmission time, but also can save each node computing and data access time. Therefore, you should give full play to the caching capabilities from the browser to the database server at all levels, and place the cache as close to the user's level as possible.
Figure 1. Network transmission exists in multiple links
This article will give some suggestions to reduce network data traffic, focusing on some suggestions to reduce the network transmission between the client browser and the server. Readers can be applied to their own WebSphere Commerce system as appropriate. (The configuration given in this article is based on the WebSphere Commerce V7 Feature Pack 4.) )
1. Reduce the size of the JSP
For JSP pages, there are two aspects of redundancy can be removed. The first class is the redundant information introduced at compile time, and the second is the unnecessary characters such as format, blank and annotation information in JSP code.
For the first type of redundancy information, you can use the Usecdatatrim property to remove it. It is recommended that you use more than 7.0 for WebSphere Commerce. This property can be used to reduce the number of white space characters introduced by <c:import> and <c:param> tags when you compile a JSP page with more than 7.0 of WebSphere Commerce. The method is as follows:
Change the file under this path $WAS _root/profiles/<profile>/config/cells/<cell>/applications/wc_<profile>. ear/ Deployments/wc_<profile>/stores.war/web-inf/ibm-web-ext.xml, add the Usecdatatrim property:
..... <jsp-attribute name= "keepgenerated" value= "true",/> <jsp-attribute name= "Trackdependencies"
True '/>
<jsp-attribute name= ' reloadenabled ' value= ' true '/> <jsp-attribute ' name=
' Reloadinterval "value="/>
<jsp-attribute name= "Usecdatatrim" value= "true"/>
< Reload-interval value= "0"/> ...