You can use zlib library (https://github.com/madler/zlib).
Copy only the *.c & *.h files from root directory. I’t compiles without problems.
You can find an example in https://github.com/loboris/ESP32_curl_example, components/zlib directory.
Library for compression algorithm for ESP32 was last modified: December 27th, 2021 by