Additional Activity Handler
The Additional Activity Handler is a callback function passed to the Enforcer. The Enforcer runs this callback after sending the page_requested
or block
activity to the Collector, and before forwarding the request to the next step in the pipeline. A common use case of the Additional Activity Handler is to set the score as a variable or header. Then the application can read the score and implement the application logic.
TO define the feature:
- Open the PX_CUSTOM.vcl file.
- Modify px_custom_additional_activity_handler to perform the required logic.
Example
sub px_custom_additional_activity_handler {
set req.http.x-px-score = if(req.http.x-px-validated-request == "1", "0", "100");
}
TO enable the feature:
v.8.0.0 and up
- Open the PX_CONFIG.vcl file.
- Set the px_additional_activity_handler_enabled value to "true" (enabled). The default is "false" (disabled).
table px_configs {
"px_additional_activity_handler_enabled": "true",
}
v7.2.0 and below
- Open the PX_CONFIG.vcl file.
- Set the PX_ENABLE_ADDITIONAL_ACTIVITY_HEADER value to "1" (enabled). The default is "0" (disabled).
table px_configs {
"PX_ENABLE_ADDITIONAL_ACTIVITY_HEADER": "1",
}
Updated 12 days ago