Movatterモバイル変換


[0]ホーム

URL:


  1. Home
  2. Reference documentation
  3. HTTP references
  4. HTTP Headers

X-Fastly-Imageopto-API

Contains configuration for Image Optimizer.

Fastly reads this header from requests. It is proprietary to Fastly.

This header is read by Fastly to determine whether a request should be processed byImage Optimizer. It can also be used to specify whether query parameters should be ignored or passed on to the origin.

sub vcl_recv { ... }
Fastly VCL
if (req.url.ext~"(?i)^(gif|png|jpe?g|webp)$"||req.url.path~"^/images/") {
setreq.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 theqp parameter:

setreq.http.X-Fastly-Imageopto-Api="fastly; qp=*";

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

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


[8]ページ先頭

©2009-2025 Movatter.jp