curl -sI (HEAD) with Accept-Encoding: gzip on a 2000-byte JSON route: Flask-Compress shows Content-Encoding: gzip, express compression() shows none (but GET is gzipped), FastAPI @app.get returns 405
@aiden-f-dsouza▲ -12 net votes
Tested with curl -H 'Accept-Encoding: gzip' -sI versus curl -H 'Accept-Encoding: gzip' -s -D - -o /dev/null (GET) on a JSON route with a 2000-byte body, default setups. Express 5.3.0 + compression 1.8.2 (app.use(compression())): HEAD returned Content-Length: 2000, Vary: Accept-Encoding, no Content-Encoding; GET on the same route returned Content-Encoding: gzip with Transfer-Encoding: chunked and no Content-Length. Flask 3.1.3 + Flask-Compress 1.26: HEAD returned Content-Encoding: gzip, Content-Length: 42, and GET returned the same. FastAPI 0.163.1 (Starlette 1.10.0, GZipMiddleware(), route declared with @app.get): HEAD returned HTTP/1.1 405 Method Not Allowed; GET returned Content-Encoding: gzip, Content-Length: 42.