How to upgrade from v2 to v3
This guide will help you navigate through changes included in version 3 of the Fastly CDN integration for a successful upgrade.
These changes aim to make the configuration of the module easier by centralizing all the settings and filters in the init.vcl snippet.
Overview of changes
- Creation of
datadome_settingsanddatadome_patternstables to configure the module - Rename
datadome_restore_referreroption toenable_referrer_restoration - Ignore matrix params from the path for the regex comparisons
- Inspection of static-looking paths containing one of
%23 %25 %2f %3b %3f
Migration steps
Step 1: Use latest snippets
Download the latest DataDome Fastly module package here.
In version 2.x.x, each setting had to be located and edited by line number across several snippets. Version 3.x.x centralizes every setting and regex into two tables, datadome_settings and datadome_patterns, declared in init.vcl. You therefore need to replace every snippets with the new ones, following the same procedure used for the initial integration:
- If you use VCL snippets through the Fastly dashboard, clone your service to a new version and re-upload each of the 7 snippets (
init,recv,miss,pass,fetch,error,deliver), replacing the previous content. - If you use regular VCL snippets with Terraform, replace the local
.vclfiles referenced by thedynamic "snippet"block with the new ones from the package.
Step 2: Migrate configurations
Open init.vcl and locate the datadome_settings and datadome_patterns table declarations. For each setting you previously customized, use the mapping below to find its new location and report the value.
datadome_settings
datadome_settings| Previous location (v2.x.x) | New setting (v3.x.x) | Notes |
|---|---|---|
License key (~line 48 of init.vcl) | server_side_key | Report the value of your server-side key into this entry. |
datadome_restore_referrer (~line 125, vcl_recv) | enable_referrer_restoration | Renamed setting, same boolean behavior. |
datadome_enable_graphql_support (~line 127, vcl_recv) | enable_graphql_support | Remove datadome prefix, now centralized in the table. |
datadome_enable_replay_protection (~line 129, vcl_recv) | enable_replay_protection | Remove datadome prefix, now centralized in the table. |
datadome_enable_mcp_support (~line 131, vcl_recv) | enable_mcp_support | Remove datadome prefix, now centralized in the table. |
| N/A (new behavior) | remove_matrix_params (default true) | New setting. Matrix params are now stripped from each path segment before it is evaluated against the datadome_patterns regexes. Set to false to keep the previous (unstripped) behavior. |
datadome_patterns
datadome_patterns| Previous location (v2.x.x) | New setting (v3.x.x) | Notes |
|---|---|---|
| Regex (~line 381, single field used to include/exclude requests from inspection) | static_asset_exclusion and url_pattern_exclusion | The single regex has been split in two: keep the default static-asset allowlist in static_asset_exclusion, and move any custom pattern you had added into url_pattern_exclusion. |
| N/A (new setting) | encoded_char_inclusion | New setting. Encoded characters matching this regex force a request that matched the static-asset exclusion back into inspection. |
| N/A (previously hardcoded) | graphql_endpoint (default (?i)graphql) | New dedicated setting for the GraphQL endpoint match, previously hardcoded in the snippet logic. |
| N/A (previously hardcoded) | mcp_endpoint (default (?i)mcp) | New dedicated setting for the MCP endpoint match, previously hardcoded in the snippet logic. |
Custom fields
The handleCustomFields subroutine (used to send userID, productID, and other custom fields) is renamed for handle_custom_fields.
Just the name of the function changed, keep your existing implementation as is.
Updated about 4 hours ago

