Many DataScript capabilities can be performed through policies and standard features. Understanding the order of precedence is crucial, as this will determine the order that various functions will occur.
For instance, if a network security policy is set to discard a connection, a DataScript set to redirect certain HTTP requests might never see the client.
DataScripts do not evaluate responses generated by Avi Load Balancer DataScripts or policies. For instance, an HTTP response generated by the HTTP request policy cannot be inspected or modified by a DataScript.
More than one DataScript may be applied to a single virtual service. The order of the DataScripts is essential, as DataScripts with the same event will be run in the order set. When adding DataScripts through the UI, use the up and down arrows next to the DataScript to reorder. The DataScript at the top of the list will run first.
Avi Load Balancer processes traffic in the following order of precedence:
Client Request
TCP profile
Network security policy
SSL handshake
HTTP security policy
DataScript authentication event
Client authentication
DataScript post authentication event
DataScript request policy
HTTP request event
Normal virtual service/pool/profile processing
Server Response
DataScript response event
HTTP response policy
Content Rewrite Profile
In the order of precedence, individual features can be inserted at different points based on the functionality of the feature. For instance, connection throttling will occur during step 1 of the client request, not step 7.