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_settings and datadome_patterns tables to configure the module
  • Rename datadome_restore_referrer option to enable_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:

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

Previous location (v2.x.x)New setting (v3.x.x)Notes
License key (~line 48 of init.vcl)server_side_keyReport the value of your server-side key into this entry.
datadome_restore_referrer (~line 125, vcl_recv)enable_referrer_restorationRenamed setting, same boolean behavior.
datadome_enable_graphql_support (~line 127, vcl_recv)enable_graphql_supportRemove datadome prefix, now centralized in the table.
datadome_enable_replay_protection (~line 129, vcl_recv)enable_replay_protectionRemove datadome prefix, now centralized in the table.
datadome_enable_mcp_support (~line 131, vcl_recv)enable_mcp_supportRemove 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

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_exclusionThe 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_inclusionNew 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.




Did this page help you?