agravelot / traefik-image-optimization

Image optimizer middleware is a Traefik plugin designed to optimize image responses on the fly.
5 stars 2 forks source link

Implement the Vary header in the response #14

Open darkweak opened 3 years ago

darkweak commented 3 years ago

Hi mate, thanks for your good work to implement Imaginary as Træfik plugin. Someone asked me to support your implementation in my cache system (https://github.com/Darkweak/Souin/issues/91). Instead of reinventing the wheel we could achieve to a working solution if you're able to implement the Vary header. I don't know which headers Imaginary uses to transform images, generate the most comfortable and most optimise image depending the client request.

You'll just have to include the vary header on L.137 inside the image_optimizer.go file.

rw.Header().Set("vary", []string{"header1", "header2", ...})

Open to discuss about that implementation with you.

agravelot commented 3 years ago

Hi, I do not plan to maintain this repository since it was used for a job offer at Traefik Labs. Feel free to fork and maintain it on your own, i'll archive this repository.