Processing Stages
  • 17 Jul 2024
  • 1 Minute to read
  • PDF

Processing Stages

  • PDF

Article summary

Overview

The Processing Stage rules are applied during a specific stage of the overall transaction (On Client Request, On Origin Request, On Client Response.)

Supported Processing Stage rules:

  • Origin Selection - This rule is applied to the client request. It influences the origin selection. Use it to direct certain client requests (for example, requests from a specified user agent) to an alternate origin.
  • Modify Origin Request - Modifies the request to the origin by manipulating the URI or headers in the request received from the client.
  • Modify Client Response - Modifies the response to the client by overriding the status code or manipulating the headers of the response from the origin.

Note that the inheritance logic for Processing Stage Rules considers them as a single entity. Therefore, if any Processing Stage rule is configured at the path level, it overrides all processing stage rules configured at the host level.

For example, if the host configuration includes an On Client Request and an On Client Response rule, and the path configuration includes an On Origin Request rule, then only the On Origin Request rule is applied to the path.

SVTA Component: MI.ProcessingStages

When you configure any of the Processing Stage rules and save the configuration version, the MI.ProcessingStages component is added to the JSON configuration.

In this example, all three Processing Stage rules are configured. For further explanation, refer to these Knowledge Base articles: Origin Selection, Modify Origin Request, Modify Client Response.

{
	"generic-metadata-type": "MI.ProcessingStages",
	"generic-metadata-value": {
		"client-response": [
			{
				"stage-metadata": [
					{
						"response-transform": {
							"headers": {
								"add": [
									{
										"value": "qwilt",
										"name": "served-by"
									}
								]
							}
						}
					}
				]
			}
		],
		"client-request": [
			{
				"stage-metadata": [
					{
						"generic-metadata": [
							{
								"generic-metadata-type": "MI.SourceMetadataExtended",
								"generic-metadata-value": {
									"sources": [
										{
											"protocol": "https/1.1",
											"endpoints": [
												"example.origin2.com"
											]
										}
									]
								}
							}
						]
					}
				],
				"match": {
					"expression": "req.h.user-agent ~= 'Mozilla'"
				}
			}
		],
		"origin-request": [
			{
				"stage-metadata": [
					{
						"request-transform": {
							"headers": {
								"add": [
									{
										"value": "qwilt",
										"name": "x-cdn"
									}
								]
							}
						}
					}
				]
			}
		]
	}
}

Was this article helpful?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.