Download original version when using Fastly image optimizer

Hi,

The customer would like to download the original image from back office media area. The problem is that when they download the image Fastly is returning the webP version.

When I look at the Fastly documentation it says that adding ?format=jpeg should do the trick but that doesn’t do anything that I can see.

Litium version: 7.7.9

Hi, are you using Image Optimizer in Fastly?

Yes, that correct.

Any thoughts on how to solve it?

Hi again,
Faslty ImageOptimization has to be configured so that it does not optimize the backoffice downloads. Do you have access to customers Fastly environment?

I will paste your answer here so you can change this to solved.

In Fastly admin there is a file called litium_recv.vcl and a line that looks like this:

if (req.url.ext ~ "(?i)^(?:gif|png|jpe?g|webp)$" && req.http.X-UA-Device != "bot")
    set req.http.x-fastly-imageopto-api = "fastly";
}

You need to change it to this:

if (req.url.ext ~ "(?i)^(?:gif|png|jpe?g|webp)$" && req.http.X-UA-Device != "bot" && req.url.qs != "forceDownload=true") {
   set req.http.x-fastly-imageopto-api = "fastly";
}
1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.