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

  1. TCP profile

  2. Network security policy

  3. SSL handshake

  4. HTTP security policy

  5. DataScript authentication event

  6. Client authentication

  7. DataScript post authentication event

  8. DataScript request policy

  9. HTTP request event

  10. Normal virtual service/pool/profile processing

Server Response

  1. DataScript response event

  2. HTTP response policy

  3. 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.