How to implement image compression on the fly using Nginx?

Problem to solve:

I am on the CentOS platform. I would like to have static image objects (jpg / gif / png) compressed to optimize web services (without resizing) while preserving the originals.

For instance,

A request sent to http://server-A/images/image.jpgwill be compressed on the fly (and cached) with a lossless / loss parameter.

I would like to achieve a similar feature effect Polishin Cloudflare, but on my own web server.

What are the tools you can use for such integration?

Alternative thought:

Is there a way to see the path /originals/for any changes, if so, then compress the offline image and bring it to the path /compressed/?

+4

Source: https://habr.com/ru/post/1669309/


All Articles