# Gzip - Http request

**URL:** <https://community.f5.com/t/gzip-http-request/29351>\
**Category:** Technical Forums\
**Tags:** asm-advanced-waf, irules, devops, application-delivery\
**Created:** [February 20, 2017, 9:18pm UTC](https://community.f5.com/t/gzip-http-request/29351 "2017-02-20T21:18:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shuki\_griba\_304](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@Shuki\_griba\_304](https://community.f5.com/u/Shuki_griba_304)\
**Post date:** [February 20, 2017, 9:18pm UTC](https://community.f5.com/t/gzip-http-request/29351/1 "2017-02-20T21:18:36Z")

</div>

```tcl
Hello 
I have a client app that send JSON requests to the server pool.

The requests are compressed with GZIP and I'm sending a Content-Encoding: gzip header.

The ASM is not uncompressing the GZIP in the request.I know it can compress/uncompress responses, but I haven't seen anywhere where I can configure it to uncompress requests

Without this functionality, I will have to drop gzip compression, which will greatly impact my app's performance. It seems to defy logic that there isn't such a functionality.

```

---

<div class="post-metadata">

**Author:** ![JG](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@JG](https://community.f5.com/u/JG)\
**Post date:** [February 21, 2017, 2:21am UTC](https://community.f5.com/t/gzip-http-request/29351/2 "2017-02-21T02:21:48Z")

</div>

Actually you can enable the compression functionality for request in an irule. See: [https://devcentral.f5.com/wiki/iRules.COMPRESS\_\_enable.ashx](https://devcentral.f5.com/wiki/iRules.COMPRESS__enable.ashx).

---

<div class="post-metadata">

**Author:** ![Vijith\_182946](https://avatars.discourse-cdn.com/v4/letter/v/b19c9b/32.png) [@Vijith\_182946](https://community.f5.com/u/Vijith_182946)\
**Post date:** [February 22, 2017, 3:47am UTC](https://community.f5.com/t/gzip-http-request/29351/3 "2017-02-22T03:47:22Z")

</div>

hope this helps- [myF5](https://support.f5.com/csp/article/K15434)

---

<div class="post-metadata">

**Author:** ![Shuki\_griba\_304](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@Shuki\_griba\_304](https://community.f5.com/u/Shuki_griba_304)\
**Post date:** [February 22, 2017, 4:48am UTC](https://community.f5.com/t/gzip-http-request/29351/4 "2017-02-22T04:48:27Z")

</div>

Thanks Vijith and Jie for your reply.

The problem is that i accept all(include the first one) the requests from the client with gzip body.

The ASM/F5 didn’t decompress the requsts and block them with false positive violations.

All the articles spoke about Http response compression.

I tried to add in the Irule HTTP::compress request, but the results are same, Decompress ☹

Any advice ?

Thanks

---

<div class="post-metadata">

**Author:** ![JG](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@JG](https://community.f5.com/u/JG)\
**Post date:** [February 22, 2017, 5:10am UTC](https://community.f5.com/t/gzip-http-request/29351/5 "2017-02-22T05:10:42Z")

</div>

As a workaround, you can set up a second virtual server with no compression support configured, and pass the traffic of your first virtual server to it. The 2nd virtual server will then be able to pick up any security vulnerabilities through the ASM. The performance will not drop that much than having no compression for your client traffic altogether.

---

<div class="post-metadata">

**Author:** ![Walter\_Kacynski](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/walter_kacynski/32/18653_2.png) [@Walter\_Kacynski](https://community.f5.com/u/Walter_Kacynski)\
**Post date:** [May 11, 2018, 8:24pm UTC](https://community.f5.com/t/gzip-http-request/29351/6 "2018-05-11T20:24:05Z")

</div>

I posted this over in: [DevCentral - An F5 Technical Community](https://devcentral.f5.com/questions/uncompress-gzip-request-with-json)

There is an iRule _DECOMPRESS::enable request_ that will accomplish this goal. I opened a support case and the engineer gave me a solution. I tested it with an LTM policy or here is the iRule:

```tcl
when HTTP_REQUEST {
  log local0. " **HTTP Request Received**"
  if { [HTTP::header "Content-Encoding"] contains "gzip"} {
    DECOMPRESS::enable request
    log local0. "Content-Encoding is GZIP, DECOMPRESS"
  }
}

```

I verified that content is uncompressed.
