For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
HUMAN DashboardHUMAN WebsiteRequest a Demo
Product GuidesEnforcer GuidesMobile SDKAPI ReferenceCustomer support
Product GuidesEnforcer GuidesMobile SDKAPI ReferenceCustomer support
  • General
    • About Enforcers
    • Support first-party HUMAN calls
    • Troubleshoot Enforcer configurations
  • Enforcer frameworks
    • Akamai ESI
    • Apache - C Module
    • ASP.NET
    • Callout Enforcer
    • Envoy Proxy
    • F5 BIGIP
    • Fastly JavaScript Compute@Edge
      • Fastly VCL changelog
        • Installing the Enforcer
        • GraphQL Support
        • Sensitive GraphQL Operations
        • Basic Configuration
        • Customized Subroutines
        • Additional Activity Handler
        • Advanced Blocking Response
        • Creating and Configuring the Edge-Dictionary
        • Custom CSS
        • Custom First Party Sensor Endpoint
        • Custom Logo
        • Custom JS Script
        • Custom Parameters
        • Filter Requests
        • Filter by HTTP Method
        • Filter by Route
        • Filter by Extension
        • Filter by IP
        • Filter by User Agent
        • Data Enrichment
        • First Party
        • First Party Snippet
        • Enforced Routes
        • Login Credentials Extraction
        • Modify First Party Response
        • Module Context Object
        • Module Enabled
        • Module Mode
        • Monitored Routes
        • Returning A Custom Block Page
        • Sensitive Routes
        • Test Block Flow on Monitoring Mode - Bypass Monitor Header
        • Upgrading the Enforcer
    • Google Cloud Platform (GCP) Callout Enforcer
    • Kong Plugin
    • NGINX - C Module
    • NGINX - LUA Module
    • PHP
    • Python
    • Ruby
    • Salesforce Commerce Cloud Cartridge
LogoLogo
Login
Login
HUMAN DashboardHUMAN WebsiteRequest a Demo
Enforcer frameworksFastly VCLV9 and Below

Additional Activity Handler

Was this page helpful?
Previous

Advanced Blocking Response

Next
Built with

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:

  1. Open the PX_CUSTOM.vcl file.
  2. Modify px_custom_additional_activity_handler to perform the required logic.

Example

1sub px_custom_additional_activity_handler {
2 set req.http.x-px-score = if(req.http.x-px-validated-request == "1", "0", "100");
3}

TO enable the feature:

v.8.0.0 and up

  1. Open the PX_CONFIG.vcl file.
  2. Set the px_additional_activity_handler_enabled value to “true” (enabled). The default is “false” (disabled).
1table px_configs {
2 "px_additional_activity_handler_enabled": "true",
3}

v7.2.0 and below

  1. Open the PX_CONFIG.vcl file.
  2. Set the PX_ENABLE_ADDITIONAL_ACTIVITY_HEADER value to “1” (enabled). The default is “0” (disabled).
1table px_configs {
2 "PX_ENABLE_ADDITIONAL_ACTIVITY_HEADER": "1",
3}