# Accept-Encoding: gzip does not seem to be compressing query response

**URL:** <https://community.influxdata.com/t/accept-encoding-gzip-does-not-seem-to-be-compressing-query-response/29737>\
**Category:** InfluxDB 2\
**Tags:** query\
**Created:** [May 1, 2023, 4:04pm UTC](https://community.influxdata.com/t/accept-encoding-gzip-does-not-seem-to-be-compressing-query-response/29737 "2023-05-01T16:04:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Soljourner](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/soljourner/32/13188_2.png) [@Soljourner](https://community.influxdata.com/u/Soljourner)\
**Post date:** [May 1, 2023, 4:04pm UTC](https://community.influxdata.com/t/accept-encoding-gzip-does-not-seem-to-be-compressing-query-response/29737/1 "2023-05-01T16:04:15Z")

</div>

I am trying to test the gzip compression for queries. Using the v2 API, I add the “Accept-Encoding: gzip” per the documentation, however the response is not compressed. Regardless of if I use the “Accept-Encoding: gzip” or not, the response size is the same.

curl --location ‘[http://localhost:8086/api/v2/query?orgID=INFLUX\_ORG\_ID](http://localhost:8086/api/v2/query?orgID=INFLUX_ORG_ID)’   
–header ‘Content-Type: application/vnd.flux’   
–header ‘Accept: application/csv’   
–header ‘Accept-Encoding: gzip’   
–header ‘Authorization: Token INFLUX\_TOKEN’   
–data 'from(bucket: “INFLUX\_BUCKET”) |\> range(start: 2023-04-26T00:00:00.000Z, stop: 2023-04-28T23:59:59.999Z) |\> filter(fn: (r) =\> r[“pump\_id”] == “63bedf53c8c25b8048a68723”) |\> filter(fn: (r) =\> r[“field\_id”] == “329370” or r[“field\_id”] == “445685” or r[“field\_id”] == “329415” or r[“field\_id”] == “329425” or r[“field\_id”] == “329420” or r[“field\_id”] == “329365” or r[“field\_id”] == “329360”)|\> aggregateWindow(every: 2s, fn: mean, createEmpty: true) |\> fill(column: “\_value”, usePrevious: true)|\> map(fn: (r) =\> ({pump\_id: r.pump\_id,field\_id: r.field\_id,sensor\_name: r.sensor\_name,timestamp: r.\_time,value: r.\_value}))  
’  
Am I doing something wrong here?

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [May 8, 2023, 8:00am UTC](https://community.influxdata.com/t/accept-encoding-gzip-does-not-seem-to-be-compressing-query-response/29737/2 "2023-05-08T08:00:36Z")

</div>

Hello @Soljourner,  
Based on the documentation:

> **[Optimize writes to InfluxDB | InfluxDB Cloud (TSM) Documentation](https://docs.influxdata.com/influxdb/cloud/write-data/best-practices/optimize-writes/?t=InfluxDB%2BAPI)**
>
> Simple tips to optimize performance and system overhead when writing data to InfluxDB.

I don’t see anything wrong there.  
Do you mind filling an issue here?

> **[GitHub - influxdata/influxdb: Scalable datastore for metrics, events, and...](https://github.com/influxdata/influxdb)**
>
> Scalable datastore for metrics, events, and real-time analytics - GitHub - influxdata/influxdb: Scalable datastore for metrics, events, and real-time analytics

Thank you!
