fontFilter is a small, focused filter that pairs well with cache and CORS related actions. It is most useful in frontend debugging sessions where typography needs to be examined alongside layout and script loading.
Use fontFilter to scope rules to responses that carry web font content, typically font/woff2, font/woff, application/font-woff, application/x-font-ttf and similar MIME types. Fonts often come from a CDN, are heavily cached, and can be a frequent source of CORS misconfiguration, all of which makes them worth filtering as a group.
Typical situations:
The filter fires on the responseHeaderReceivedFromRemote scope. Combine it with hostFilter if you want to restrict it to a specific font provider such as a self hosted CDN.
Force the browser to refetch fonts on every reload while you tune a custom font face configuration.
rules:
- filter:
typeKind: FontFilter
actions:
- typeKind: RemoveCacheAction
Allow the application origin to consume fonts from a private CDN during integration testing without changing the CDN configuration.
rules:
- filter:
typeKind: FilterCollection
operation: and
children:
- typeKind: HostFilter
pattern: cdn.example.com
operation: Exact
- typeKind: FontFilter
actions:
- typeKind: AddResponseHeaderAction
headerName: Access-Control-Allow-Origin
headerValue: https://app.example.com
Tag every font response in the capture so you can later count, group and review them in a static asset audit.
rules:
- filter:
typeKind: FontFilter
actions:
- typeKind: ApplyTagAction
tag:
value: font-asset
Select exchanges having response content type matching a font payload.
Evaluation scope defines the timing where this filter will be applied.
responseHeaderReceivedFromRemote This scope occurs the moment fluxzy has done parsing the response header.
fontFilter
This filter has no specific characteristic
The following table describes the customizable properties available for this filter:
| Property | Type | Description | DefaultValue |
|---|---|---|---|
| inverted | boolean | Negate the filter result | false |
The following examples apply a comment to the filtered exchange
Select exchanges having response content type matching a font payload.
rules:
- filter:
typeKind: FontFilter
actions:
- typeKind: ApplyCommentAction
comment: filter was applied
View definition of FontFilter for .NET integration.
The following filters are related to this filter:
The standard font media types such as font/woff2, font/woff, font/ttf, application/font-woff and application/x-font-ttf. Generic or incorrect MIME types may not match.
Not with fontFilter alone, it groups all font media types. Use a requestHeaderFilter or pathFilter to match a specific extension.
No. fontFilter looks at the response Content-Type header. Font requests typically carry no Content-Type because the body is empty.
They cover different MIME families. Combine them inside a filterCollection with operation: or to select any static asset of a page.