---
title: X-Fastly-Imageopto-API
summary: null
url: >-
  https://www.fastly.com/documentation/reference/http/http-headers/X-Fastly-Imageopto-API
---

This header is read by Fastly to determine whether a request should be processed by [Image Optimizer](https://docs.fastly.com/products/image-optimizer). It can also be used to specify whether query parameters should be ignored or passed on to the origin.

```vcl context="sub vcl_recv { ... }"
if (req.url.ext ~ "(?i)^(?:gif|png|jpe?g|webp|avif|jxl|heic)\z" || req.url.path ~ "^/images/") {
  set req.http.x-fastly-imageopto-api = "fastly";
}
```

By default, _all query parameters are stripped_, even those that are not recognized by the image optimizer.  To allow passthrough of custom query params (i.e. those that are not recognised by IO) to your origin, opt-in by changing the value to include the `qp` parameter:

```vcl
set req.http.X-Fastly-Imageopto-Api = "fastly; qp=*";
```

With this opt-in enabled, a request for `image.png?width=300&something=foo` would trigger the original image to be loaded from your origin server with a request URI of `image.png?something=foo`.  The known parameter has been removed, but the unknown parameter was passed through.

> **WARNING:** Enabling the `qp=*` override may reduce the image cache hit ratio and increase traffic to your origin servers.

> **IMPORTANT:** When using this header to enable Image Optimizer, it must be set at both the edge and shield.
