TransformRule
interface TransformRule {
rules?: SpeedKitRule[];
target?: TransformTarget[];
transformFunction: string | TransformFunction;
}
rules?: SpeedKitRule[];
target?: TransformTarget[];
transformFunction: string | TransformFunction;
}
Index
Properties
Properties
Optionalrules
The rules to match resources against.
Optionaltarget
The Speed Kit request targets this transform should apply to.
- TransformTarget.Asset applies to Asset API requests
- TransformTarget.Origin applies to Dynamic Block (origin) requests Provide both to apply to both. Defaults to [TransformTarget.Asset].
Warning: Targeting TransformTarget.Origin should be used sparingly. While the Service Worker sends an unchanged navigate request to preserve Safari's navigation context and preloads the transformed Dynamic Block response separately, broad usage can still have unintended side effects. Limit Origin transforms to a small, well-defined subset of requests.
transform Function
The function to determine the URL for the requested resource.
This rule transform the URL for the matching requests. See SpeedKitConfig.urlTransform | the custom variation option for more information.
Since
1.23.0