New Transparent capture is in preview. Record every app's traffic with no proxy configuration, on Windows, macOS and Linux. Learn more

imageFilter Filter

Match responses whose Content-Type indicates an image, so you can tag, log, or rewrite media without scanning unrelated traffic.

Image traffic is often a large fraction of a page load, and it usually deserves its own treatment when you are debugging caching, throttling, or asset delivery. The imageFilter gives you a single selector that covers every modern image format, so you can tag, log, or rewrite media calls without enumerating MIME types by hand.

When to use this filter

Use imageFilter when a rule should run only on responses returning an image, regardless of the specific format. The filter checks the response Content-Type for an image/* value, so it covers PNG, JPEG, GIF, WebP, AVIF, SVG, and any other image type a server might emit.

Common scenarios:

  • Excluding image traffic from a noisy throttling or logging rule.
  • Counting or tagging image responses while reviewing a page load.
  • Forcing a longer cache lifetime on images served from a known origin.

Real world examples

Tag every image response for quick filtering

Label image responses so they stand out from HTML and API traffic in the session viewer.

rules:
- filter:
    typeKind: ImageFilter
  actions:
  - typeKind: ApplyTagAction
    tag:
      value: image-asset

Force a long cache lifetime on a specific host's images

Tell the client to cache images aggressively when debugging cache invalidation issues.

rules:
- filter:
    typeKind: FilterCollection
    operation: And
    children:
    - typeKind: ImageFilter
    - typeKind: HostFilter
      pattern: cdn.example.com
      operation: Exact
  actions:
  - typeKind: AddResponseHeaderAction
    headerName: cache-control
    headerValue: public, max-age=31536000, immutable

Throttle image responses to simulate a slow CDN

Cap bandwidth on image traffic only, to observe how a page degrades under slow media loading.

rules:
- filter:
    typeKind: ImageFilter
  actions:
  - typeKind: AverageThrottleAction
    bandwidthBytesPerSeconds: 16384

Reference

imageFilter

Description

Select exchanges having response content type mime matching image.

Evaluation scope

Evaluation scope defines the timing where this filter will be applied.

responseHeaderReceivedFromRemote This scope occurs the moment fluxzy has done parsing the response header.

YAML configuration name

imageFilter

Settings

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

Example of usage

The following examples apply a comment to the filtered exchange

Select exchanges having response content type mime matching image.

rules:
- filter:
    typeKind: ImageFilter
  actions:
  - typeKind: ApplyCommentAction
    comment: filter was applied

.NET reference

View definition of ImageFilter for .NET integration.

See also

The following filters are related to this filter:

Frequently asked questions

Does it match SVG and AVIF responses?

Yes. Any Content-Type starting with image/ is matched, which covers modern formats like SVG, AVIF, and WebP alongside the classics.

Will it inspect the bytes if the server lies about Content-Type?

No. The filter trusts the header. Combine it with body inspection or responseHeaderFilter if you need to validate against the payload.

Can I exclude one specific image format?

Yes. Combine imageFilter with an inverted responseHeaderFilter matching the format you want to skip, all inside a FilterCollection with the And operation.

Learn more about Fluxzy rules